mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-06-10 23:06:04 -04:00
This commit is contained in:
@@ -1,22 +1,15 @@
|
||||
using System.Collections;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Serilog;
|
||||
|
||||
namespace Infrastructure.Logging;
|
||||
|
||||
/// <summary>
|
||||
/// A background service that initializes deferred logging components after startup
|
||||
/// </summary>
|
||||
// TODO remove
|
||||
public class LoggingInitializer : BackgroundService
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly ILogger<LoggingInitializer> _logger;
|
||||
|
||||
public LoggingInitializer(IServiceProvider serviceProvider, ILogger<LoggingInitializer> logger)
|
||||
public LoggingInitializer(ILogger<LoggingInitializer> logger)
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -26,7 +19,7 @@ public class LoggingInitializer : BackgroundService
|
||||
{
|
||||
try
|
||||
{
|
||||
throw new Exception("eroare e ceva ce multa lume n-are, ye");
|
||||
throw new Exception("test exception");
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -35,7 +28,5 @@ public class LoggingInitializer : BackgroundService
|
||||
|
||||
await Task.Delay(30000, stoppingToken);
|
||||
}
|
||||
|
||||
// We only need to run this once at startup
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user