fix(pi): keep active runs alive during background sleep

This commit is contained in:
2026-08-25 20:56:17 +08:00
parent 92f4c91088
commit 621ebb1781
22 changed files with 1061 additions and 68 deletions

View File

@@ -101,6 +101,7 @@ export class BackgroundLifecycleController extends EventEmitter {
this.stopping = true;
try {
await this.options.onSleep();
if (!this.shouldSleep() || this.leases.size > 0) return;
await this.options.onStopRuntime();
this.emit('sleep');
} finally {