Skip to content

Commit 613d486

Browse files
committed
stop tasks with missmatch cronId
1 parent 43cc6d3 commit 613d486

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4367,7 +4367,11 @@ export class BaileysStartupService extends ChannelStartupService {
43674367
const cache = this.chatwootService.getCache();
43684368
if (cache) {
43694369
const storedId = await cache.hGet(cronKey, this.instance.name);
4370-
if (storedId && storedId !== cronId) return;
4370+
if (storedId && storedId !== cronId) {
4371+
this.logger.info(`Stopping syncChatwootLostMessages cron - ID mismatch: ${cronId} vs ${storedId}`);
4372+
task.stop();
4373+
return;
4374+
}
43714375
}
43724376
this.chatwootService.syncLostMessages({ instanceName: this.instance.name }, chatwootConfig, prepare);
43734377
});

0 commit comments

Comments
 (0)