Update stuff
This commit is contained in:
parent
0254e42b9c
commit
553ba9db9a
40 changed files with 7343 additions and 717 deletions
31
worker.js
Normal file
31
worker.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
import co from 'co';
|
||||
import kue from 'kue';
|
||||
import raven from 'raven';
|
||||
import debuglog from 'debug';
|
||||
|
||||
import models from '../models';
|
||||
|
||||
const debug = debuglog('hostr:worker');
|
||||
|
||||
raven.config(process.env.SENTRY_DSN).install();
|
||||
|
||||
const queue = kue.createQueue({
|
||||
redis: process.env.REDIS_URL,
|
||||
});
|
||||
|
||||
function store(data, done) {
|
||||
co(function* gen() { // eslint-disable-line no-loop-func
|
||||
|
||||
}).catch((err) => {
|
||||
debug(err);
|
||||
raven.captureException(err);
|
||||
return done();
|
||||
});
|
||||
}
|
||||
|
||||
queue.process('store', 5, (job, done) => {
|
||||
store(job.data, done);
|
||||
});
|
||||
|
||||
|
||||
kue.app.listen(3000);
|
Loading…
Add table
Add a link
Reference in a new issue