Skip to content

Commit 19a5718

Browse files
committed
Expire dev queue consumer connections keys
1 parent f9796b2 commit 19a5718

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/webapp/app/v3/marqs/devQueueConsumer.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export class DevQueueConsumer {
243243
return;
244244
}
245245

246-
await this._redisClient.set(`connection:${this.env.id}`, this.id);
246+
await this._redisClient.set(`connection:${this.env.id}`, this.id, "EX", 60 * 60 * 24); // 24 hours
247247

248248
this._enabled = true;
249249
// Create the session
@@ -283,7 +283,7 @@ export class DevQueueConsumer {
283283

284284
const currentConnection = await this._redisClient.get(`connection:${this.env.id}`);
285285

286-
if (currentConnection !== this.id) {
286+
if (currentConnection && currentConnection !== this.id) {
287287
logger.debug("Another connection is active, stopping the consumer", {
288288
currentConnection,
289289
env: this.env,

0 commit comments

Comments
 (0)