mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-14 01:55:58 -07:00
fix(stats): harden delete maintenance queue and shutdown handling
- Flush pending writes before locking during maintenance - Handle scheduler failures and worker shutdown races
This commit is contained in:
@@ -58,7 +58,9 @@ export class DeleteMaintenanceScheduler {
|
||||
}
|
||||
|
||||
private scheduleDrain(): void {
|
||||
if (this.destroyed || this.running || this.drainTimer) return;
|
||||
if (this.destroyed || this.running || this.drainTimer || this.pendingRequests.length === 0) {
|
||||
return;
|
||||
}
|
||||
this.drainTimer = setTimeout(() => {
|
||||
this.drainTimer = null;
|
||||
void this.drain();
|
||||
|
||||
Reference in New Issue
Block a user