mirror of
https://github.com/zhigang1992/mtcute.git
synced 2026-01-12 17:32:35 +08:00
feat: warn every 100 queued updates
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user