diff --git a/src/datastore/redis-notifier.ts b/src/datastore/redis-notifier.ts index a34f06789..860104a22 100644 --- a/src/datastore/redis-notifier.ts +++ b/src/datastore/redis-notifier.ts @@ -50,7 +50,7 @@ export class RedisNotifier { }, }; logger.debug(message, 'RedisNotifier broadcasting index progress message'); - await this.redis.rpush(this.queue, JSON.stringify(message)); + await this.redis.xadd(this.queue, '*', 'data', JSON.stringify(message)); } async close() { diff --git a/tests/api/redis-notifier.test.ts b/tests/api/redis-notifier.test.ts index 0236574ba..777c3c673 100644 --- a/tests/api/redis-notifier.test.ts +++ b/tests/api/redis-notifier.test.ts @@ -3,7 +3,7 @@ const messages: string[] = []; // Mock Redis to capture messages jest.mock('ioredis', () => { const redisMock = jest.fn().mockImplementation(() => ({ - rpush: jest.fn((_, message) => { + xadd: jest.fn((queue, id, field, message) => { messages.push(message); }), quit: jest.fn().mockResolvedValue(undefined),