Guest User

Untitled

a guest
Jan 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. for(var i in cases) {
  2. var thequery = 'INSERT IGNORE INTO `cases` SET keysused='+cases.keysused+'
  3. pool.query(thequery, function(ee, rr) {
  4. if(ee) {
  5. logger.info(ee);
  6. throw ee;
  7. }
  8. });
  9. }
  10.  
  11. var db_config = {
  12. connectionLimit : 5000,
  13. host: 'localhost',
  14. user: 'userexample'
  15. password: '*******',
  16. database: 'example.com'
  17. };
  18.  
  19. function database_connection() {
  20. pool = mysql.createPool(db_config);
  21. pool.getConnection(function(err, connection) {
  22. if(err) {
  23. logger.error('[ERROR] Connecting to database "' + err.toString() + '"');
  24. setTimeout(function() { database_connection(); }, 2500);
  25. }
  26. else
  27. {
  28. pool.query('SET NAMES utf8');
  29. pool.query('SET CHARACTER SET utf8');
  30. logger.trace('[INFO] Connected to database and set utf8!');
  31. }
  32. });
Add Comment
Please, Sign In to add comment