mirror of
https://github.com/MeowCraftMC/CrystalConnector
synced 2025-05-22 02:43:00 +00:00
@@ -32,6 +32,8 @@ public class CrystalService : IHostedService
|
||||
|
||||
private void OnStopped()
|
||||
{
|
||||
Logger.LogInformation("Goodbye!");
|
||||
LogManager.Shutdown();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
@@ -41,8 +43,6 @@ public class CrystalService : IHostedService
|
||||
|
||||
public Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
LogManager.Shutdown();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,10 @@ var builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
builder.Services.AddHostedService<CrystalService>();
|
||||
|
||||
// builder.Services.AddSingleton<Bot>();
|
||||
|
||||
builder.Environment.ContentRootPath = Directory.GetCurrentDirectory();
|
||||
|
||||
builder.Configuration.AddJsonFile("config.json", true)
|
||||
.AddJsonFile($"config.{builder.Environment.EnvironmentName}.json")
|
||||
.AddJsonFile($"config.{builder.Environment.EnvironmentName}.json", true)
|
||||
.AddEnvironmentVariables(prefix: "CRYSTAL_")
|
||||
.AddCommandLine(args);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user