File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,14 @@ module.exports = function(extraJob) {
171
171
// 3. Queue the job to actually be run now that it is locked
172
172
// 4. Recursively run this same method we are in to check for more available jobs of same type!
173
173
if ( job ) {
174
+ // Before en-queing job make sure we haven't exceed our lock limits
175
+ if ( ! shouldLock ( name ) ) {
176
+ debug ( 'lock limit reached before job was returned. Releasing lock on [%s]' , name ) ;
177
+ job . attrs . lockedAt = null ;
178
+ self . saveJob ( job ) ;
179
+ return ;
180
+ }
181
+
174
182
debug ( '[%s:%s] job locked while filling queue' , name , job . attrs . _id ) ;
175
183
self . _lockedJobs . push ( job ) ;
176
184
definitions [ job . attrs . name ] . locked ++ ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @hokify/agenda" ,
3
- "version" : " 3.1.4 " ,
3
+ "version" : " 3.1.5 " ,
4
4
"description" : " Light weight job scheduler for Node.js" ,
5
5
"main" : " index.js" ,
6
6
"files" : [
You can’t perform that action at this time.
0 commit comments