Skip to content

Commit 6cb1e45

Browse files
committed
ack comment
1 parent ba5b2ab commit 6cb1e45

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apps/sim/lib/core/async-jobs/backends/redis.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

packages/testing/src/mocks/redis.mock.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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),

0 commit comments

Comments
 (0)