✨ Remove useless code.

Signed-off-by: 秋雨落 <i@rain.cx>
This commit is contained in:
秋雨落
2023-09-12 07:22:42 +08:00
parent 32e444d7e8
commit b0b4a6faf1
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -32,6 +32,8 @@ public class CrystalService : IHostedService
private void OnStopped() private void OnStopped()
{ {
Logger.LogInformation("Goodbye!");
LogManager.Shutdown();
} }
public Task StartAsync(CancellationToken cancellationToken) public Task StartAsync(CancellationToken cancellationToken)
@@ -41,8 +43,6 @@ public class CrystalService : IHostedService
public Task StopAsync(CancellationToken cancellationToken) public Task StopAsync(CancellationToken cancellationToken)
{ {
LogManager.Shutdown();
return Task.CompletedTask; return Task.CompletedTask;
} }
} }
+2 -3
View File
@@ -10,11 +10,10 @@ var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddHostedService<CrystalService>(); builder.Services.AddHostedService<CrystalService>();
// builder.Services.AddSingleton<Bot>();
builder.Environment.ContentRootPath = Directory.GetCurrentDirectory(); builder.Environment.ContentRootPath = Directory.GetCurrentDirectory();
builder.Configuration.AddJsonFile("config.json", true) builder.Configuration.AddJsonFile("config.json", true)
.AddJsonFile($"config.{builder.Environment.EnvironmentName}.json") .AddJsonFile($"config.{builder.Environment.EnvironmentName}.json", true)
.AddEnvironmentVariables(prefix: "CRYSTAL_") .AddEnvironmentVariables(prefix: "CRYSTAL_")
.AddCommandLine(args); .AddCommandLine(args);