Skip to content

Commit 290625e

Browse files
authored
Keep service scope alive (#8270)
1 parent 214a5cf commit 290625e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/lib/service/entrypoint/analyzer.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Future _workerMain(EntryMessage message) async {
6666
await popularityStorage.start();
6767
await downloadCountsBackend.start();
6868
await taskBackend.start();
69+
registerScopeExitCallback(() => taskBackend.stop());
6970

7071
setupAnalyzerPeriodicTasks();
7172
setupSearchPeriodicTasks();
@@ -86,4 +87,8 @@ Future _apiExporterMain(EntryMessage message) async {
8687
await popularityStorage.start();
8788
await downloadCountsBackend.start();
8889
await apiExporter!.start();
90+
registerScopeExitCallback(() => apiExporter!.stop());
91+
92+
// wait indefinitely
93+
await Completer().future;
8994
}

0 commit comments

Comments
 (0)