mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-15 04:03:07 +00:00
chore: add logs for subscription maintenance
This commit is contained in:
parent
8caa220e8f
commit
4554eeab91
@ -1,4 +1,4 @@
|
||||
export const DEFAULT_KEEP_ALIVE = 30 * 1000;
|
||||
export const DEFAULT_KEEP_ALIVE = 10_000;
|
||||
|
||||
export const DEFAULT_SUBSCRIBE_OPTIONS = {
|
||||
keepAlive: DEFAULT_KEEP_ALIVE
|
||||
|
||||
@ -253,11 +253,13 @@ export class SubscriptionManager implements ISubscription {
|
||||
}
|
||||
|
||||
private startSubscriptionsMaintenance(interval: number): void {
|
||||
log.info("Starting subscriptions maintenance");
|
||||
this.startKeepAlivePings(interval);
|
||||
this.startConnectionListener();
|
||||
}
|
||||
|
||||
private stopSubscriptionsMaintenance(): void {
|
||||
log.info("Stopping subscriptions maintenance");
|
||||
this.stopKeepAlivePings();
|
||||
this.stopConnectionListener();
|
||||
}
|
||||
@ -301,6 +303,7 @@ export class SubscriptionManager implements ISubscription {
|
||||
}
|
||||
|
||||
this.keepAliveTimer = setInterval(() => {
|
||||
log.info("Sending keep-alive ping");
|
||||
void this.ping()
|
||||
.then(() => log.info("Keep-alive ping successful"))
|
||||
.catch((error) => log.error("Error in keep-alive ping cycle:", error));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user