From 9eb79e5c5d8c35ba4803b0393baaafec07689948 Mon Sep 17 00:00:00 2001 From: Graham Rogers Date: Wed, 15 Feb 2023 16:59:15 +0000 Subject: [PATCH] Return the Promises from Redis We need to be able to wait for the operation to finish before calling disconnect. --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 03ad255..76041c7 100644 --- a/src/index.js +++ b/src/index.js @@ -43,13 +43,13 @@ class Sidekiq { payload.enqueued_at = payload.at.getTime() / 1000; payload.at = payload.enqueued_at; - this.redisConnection.zAdd( + return this.redisConnection.zAdd( this.namespaceKey("schedule"), [{score: payload.enqueued_at, value: JSON.stringify(payload)}], cb ); } else { - this.redisConnection.lPush( + return this.redisConnection.lPush( this.getQueueKey(payload.queue), JSON.stringify(payload), err => {