()
| 542 | } |
| 543 | |
| 544 | async stop(): Promise<void> { |
| 545 | try { |
| 546 | await this.workQueue.flush(); |
| 547 | } catch (e: any) { |
| 548 | this.logger.logLabeled( |
| 549 | "WARN", |
| 550 | "functions", |
| 551 | "Functions emulator work queue did not empty before stopping", |
| 552 | ); |
| 553 | } |
| 554 | |
| 555 | this.workQueue.stop(); |
| 556 | for (const pool of Object.values(this.workerPools)) { |
| 557 | pool.exit(); |
| 558 | } |
| 559 | |
| 560 | for (const watcher of this.watchers) { |
| 561 | await watcher.close(); |
| 562 | } |
| 563 | this.watchers = []; |
| 564 | |
| 565 | // Stop delegate watch processes (e.g., build_runner for Dart) |
| 566 | for (const cleanup of this.watchCleanups) { |
| 567 | await cleanup(); |
| 568 | } |
| 569 | this.watchCleanups = []; |
| 570 | |
| 571 | if (this.destroyServer) { |
| 572 | await this.destroyServer(); |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | async discoverTriggers( |
| 577 | emulatableBackend: EmulatableBackend, |
nothing calls this directly
no test coverage detected