Skip to content

Commit 8932db8

Browse files
committed
support IAsyncDIsposable
1 parent 22a073b commit 8932db8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ConsoleAppFramework/ConsoleAppEngineService.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ public async Task StopAsync(CancellationToken cancellationToken)
8585
}
8686
finally
8787
{
88-
scope.Dispose();
88+
if (scope is IAsyncDisposable asyncDisposable)
89+
{
90+
await asyncDisposable.DisposeAsync();
91+
}
92+
else
93+
{
94+
scope.Dispose();
95+
}
8996
}
9097
}
9198
}

0 commit comments

Comments
 (0)