fix server does not shut down
This commit is contained in:
parent
53cbdd8440
commit
8b44168b66
9 changed files with 59 additions and 47 deletions
|
@ -0,0 +1,42 @@
|
|||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
internal class LoggingLifecycleService(ILogger logger) : IHostedLifecycleService
|
||||
{
|
||||
private protected readonly ILogger Logger = logger;
|
||||
|
||||
public virtual Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Logger.LogDebug("StartAsync");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task StartedAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Logger.LogDebug("StartedAsync");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task StartingAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Logger.LogDebug("StartingAsync");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Logger.LogDebug("StopAsync");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task StoppedAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Logger.LogDebug("StoppedAsync");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task StoppingAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Logger.LogDebug("StoppingAsync");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue