api: Allow reprocessing of stalled jobs
This commit is contained in:
parent
23843481c6
commit
44a18657f6
|
@ -202,7 +202,7 @@ class Track extends mongoose.Model {
|
|||
|
||||
await this.save();
|
||||
|
||||
return await queue.add(
|
||||
await queue.add(
|
||||
'processTrack',
|
||||
{
|
||||
trackId: this._id.toString(),
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
const Bull = require('bull')
|
||||
const Bull = require('bull');
|
||||
|
||||
const config = require('./config')
|
||||
const config = require('./config');
|
||||
|
||||
module.exports = new Bull('processQueue', config.redisUrl)
|
||||
module.exports = new Bull('processQueue', config.redisUrl, {
|
||||
settings: {
|
||||
// if the worker process is killed and restarted, e.g. due to reboot or
|
||||
// upgrade, it is okay to wait for a timeout on the job and restart it
|
||||
maxStalledCount: 3,
|
||||
lockDuration: 120 * 1000,
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue