Add more debug output to worker
This commit is contained in:
parent
82fa61f5d5
commit
46142d12de
2 changed files with 9 additions and 3 deletions
|
@ -1,10 +1,13 @@
|
|||
import co from 'co';
|
||||
import kue from 'kue';
|
||||
import raven from 'raven';
|
||||
import debuglog from 'debug';
|
||||
|
||||
import models from './models';
|
||||
import services from './lib/services';
|
||||
|
||||
const debug = debuglog('combine.fm:worker');
|
||||
|
||||
raven.config(process.env.SENTRY_DSN).install();
|
||||
|
||||
const queue = kue.createQueue({
|
||||
|
@ -14,7 +17,7 @@ const queue = kue.createQueue({
|
|||
function search(data, done) {
|
||||
const share = data.share;
|
||||
const service = services.find(item => data.service.id === item.id);
|
||||
console.log(service);
|
||||
debug(`Searching on: ${service}`);
|
||||
co(function* gen() { // eslint-disable-line no-loop-func
|
||||
try {
|
||||
const match = yield service.search(share);
|
||||
|
@ -49,7 +52,9 @@ function search(data, done) {
|
|||
return done(err);
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
debug(`Error searching on: ${service}`);
|
||||
debug(share);
|
||||
debug(err);
|
||||
raven.captureException(err);
|
||||
return done();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue