mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 11:52:20 -06:00
stop tasks with missmatch cronId
This commit is contained in:
@@ -4367,7 +4367,11 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
const cache = this.chatwootService.getCache();
|
const cache = this.chatwootService.getCache();
|
||||||
if (cache) {
|
if (cache) {
|
||||||
const storedId = await cache.hGet(cronKey, this.instance.name);
|
const storedId = await cache.hGet(cronKey, this.instance.name);
|
||||||
if (storedId && storedId !== cronId) return;
|
if (storedId && storedId !== cronId) {
|
||||||
|
this.logger.info(`Stopping syncChatwootLostMessages cron - ID mismatch: ${cronId} vs ${storedId}`);
|
||||||
|
task.stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.chatwootService.syncLostMessages({ instanceName: this.instance.name }, chatwootConfig, prepare);
|
this.chatwootService.syncLostMessages({ instanceName: this.instance.name }, chatwootConfig, prepare);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user