3 var onMongoConnect = require('gitter-web-persistence-utils/lib/on-mongo-connect');
4 var debug = require('debug')('gitter:infra:workers');
8 exports.listen = function() {
12 debug('Starting scheduler instance');
13 require('gitter-web-utils/lib/worker-queue-redis').startScheduler();
15 // Do not start the workers until theres a valid mongo connection
16 // A redis connection is implied since resque needs redis to process
18 onMongoConnect().then(function() {
19 debug('Starting works on successful mongodb connection');
20 require('gitter-web-unread-items/lib/readby-service').listen();
21 require('gitter-web-unread-items').listen();
22 require('../services/notifications/push-notification-postbox').listen();