feat: warn every 100 queued updates

This commit is contained in:
alina sireneva
2025-05-10 13:12:41 +03:00
parent b9b142d8b8
commit 870cba46dd

View File

@@ -85,6 +85,8 @@ import {
// return state.rpsProcessing.getRps()
// }
const WARN_EVERY = 100
const KEEP_ALIVE_INTERVAL = 15 * 60 * 1000 // 15 minutes
const UPDATES_TOO_LONG = { _: 'updatesTooLong' } as const
@@ -330,6 +332,10 @@ export class UpdatesManager {
assertNever(update)
}
if (this.pendingUpdateContainers.length % WARN_EVERY === 0) {
this.log.warn('%d pending update containers, updatesLoopActive = %b. possible memory leak', this.pendingUpdateContainers.length, this.updatesLoopActive)
}
this.updatesLoopCv.notify()
}