mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 04:02:54 -06:00
changelog
This commit is contained in:
parent
4274c7afdb
commit
4ed1335f89
@ -135,10 +135,7 @@ export class BaileysStartupService extends WAStartupService {
|
|||||||
this.cleanStore();
|
this.cleanStore();
|
||||||
this.instance.qrcode = { count: 0 };
|
this.instance.qrcode = { count: 0 };
|
||||||
this.mobile = false;
|
this.mobile = false;
|
||||||
|
this.recoveringMessages();
|
||||||
setTimeout(() => {
|
|
||||||
this.recoveringMessages();
|
|
||||||
}, 30000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly msgRetryCounterCache: CacheStore = new NodeCache();
|
private readonly msgRetryCounterCache: CacheStore = new NodeCache();
|
||||||
@ -152,15 +149,19 @@ export class BaileysStartupService extends WAStartupService {
|
|||||||
public mobile: boolean;
|
public mobile: boolean;
|
||||||
|
|
||||||
private async recoveringMessages() {
|
private async recoveringMessages() {
|
||||||
this.logger.info('Recovering messages');
|
setTimeout(async () => {
|
||||||
this.messagesLostCache.keys().then((keys) => {
|
this.logger.info('Recovering messages');
|
||||||
keys.forEach(async (key) => {
|
this.messagesLostCache.keys().then((keys) => {
|
||||||
const message = await this.messagesLostCache.get(key.split(':')[2]);
|
keys.forEach(async (key) => {
|
||||||
|
const message = await this.messagesLostCache.get(key.split(':')[2]);
|
||||||
|
|
||||||
if (message.messageStubParameters && message.messageStubParameters[0] === 'Message absent from node')
|
if (message.messageStubParameters && message.messageStubParameters[0] === 'Message absent from node') {
|
||||||
await this.client.sendMessageAck(JSON.parse(message.messageStubParameters[1], BufferJSON.reviver));
|
this.logger.verbose('Message absent from node, retrying to send, key: ' + key.split(':')[2]);
|
||||||
|
await this.client.sendMessageAck(JSON.parse(message.messageStubParameters[1], BufferJSON.reviver));
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}, 30000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get connectionStatus() {
|
public get connectionStatus() {
|
||||||
|
Loading…
Reference in New Issue
Block a user