Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. async.waterfall([
  2. function(step) {
  3.  
  4. console.log('ASSSSSSSSYNC in user here' + identifier);
  5.  
  6. switch(identifier) {
  7. case 'user':
  8. //Models.CodeUsage.countByUser(identifier, step);
  9. step(null, 1);
  10. break;
  11. case 'cim':
  12. step(null, 0);
  13. break;
  14. }
  15.  
  16. }
  17. ], function(err, identifier_uses) {
  18. if (err) { return callback(err); }
  19. if (identifier_uses >= max_identifier_uses) {
  20. console.log('- ' + identifier_uses + ' > ' + max_identifier_uses);
  21. return false;
  22. }
  23.  
  24. console.log('- ' + identifier_uses + ' <= ' + max_identifier_uses);
  25.  
  26. return true;
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement