File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
apps/sim/lib/core/async-jobs/backends
packages/testing/src/mocks Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -99,13 +99,14 @@ export class RedisJobQueue implements JobQueueBackend {
9999
100100 async startJob ( jobId : string ) : Promise < void > {
101101 const now = new Date ( )
102+ const key = KEYS . job ( jobId )
102103
103- await this . redis . hset ( KEYS . job ( jobId ) , {
104+ await this . redis . hset ( key , {
104105 status : JOB_STATUS . PROCESSING ,
105106 startedAt : now . toISOString ( ) ,
106- attempts : '1' ,
107107 updatedAt : now . toISOString ( ) ,
108108 } )
109+ await this . redis . hincrby ( key , 'attempts' , 1 )
109110
110111 logger . debug ( 'Started job' , { jobId } )
111112 }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export function createMockRedis() {
2121 hgetall : vi . fn ( ) . mockResolvedValue ( { } ) ,
2222 hdel : vi . fn ( ) . mockResolvedValue ( 1 ) ,
2323 hmset : vi . fn ( ) . mockResolvedValue ( 'OK' ) ,
24+ hincrby : vi . fn ( ) . mockResolvedValue ( 1 ) ,
2425
2526 // Key operations
2627 get : vi . fn ( ) . mockResolvedValue ( null ) ,
You can’t perform that action at this time.
0 commit comments