Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(var i in cases) {
- var thequery = 'INSERT IGNORE INTO `cases` SET keysused='+cases.keysused+'
- pool.query(thequery, function(ee, rr) {
- if(ee) {
- logger.info(ee);
- throw ee;
- }
- });
- }
- var db_config = {
- connectionLimit : 5000,
- host: 'localhost',
- user: 'userexample'
- password: '*******',
- database: 'example.com'
- };
- function database_connection() {
- pool = mysql.createPool(db_config);
- pool.getConnection(function(err, connection) {
- if(err) {
- logger.error('[ERROR] Connecting to database "' + err.toString() + '"');
- setTimeout(function() { database_connection(); }, 2500);
- }
- else
- {
- pool.query('SET NAMES utf8');
- pool.query('SET CHARACTER SET utf8');
- logger.trace('[INFO] Connected to database and set utf8!');
- }
- });
Add Comment
Please, Sign In to add comment