File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,13 @@ const configRedis = require('../config/redis');
44class CheckCompletion {
55 constructor ( ) {
66 this . options = {
7- host : configRedis . auxRedisHost ,
8- port : configRedis . auxRedisPort ,
7+ host : configRedis . auxRedisHost ,
8+ port : configRedis . auxRedisPort ,
99 } ;
1010 }
1111
1212 async increment (
13- key
13+ key ,
1414 ) {
1515 const redis = new Redis (
1616 this . options ,
@@ -24,22 +24,22 @@ class CheckCompletion {
2424 }
2525
2626 async decrement (
27- key
27+ key ,
2828 ) {
2929 const redis = new Redis (
3030 this . options ,
3131 ) ;
3232 const luaScript = `
33- local count = redis.call('DECR', KEYS[1])
34- return count
33+ local count = redis.call('DECR', KEYS[1])
34+ return count
3535 ` ;
3636
3737 const result = await redis . eval ( luaScript , 1 , key ) ;
3838 if ( result === 0 ) {
39- console . log ( 'Last job completed.' ) ;
40- await redis . del ( key ) ;
39+ console . log ( 'Last job completed.' ) ;
40+ await redis . del ( key ) ;
4141 } else {
42- console . log ( `Jobs remaining: ${ result } ` ) ;
42+ console . log ( `Jobs remaining: ${ result } ` ) ;
4343 }
4444 return result ;
4545 }
You can’t perform that action at this time.
0 commit comments