Skip to content

Commit

Permalink
Rename more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Sella-GH committed Jun 10, 2024
1 parent bac4d26 commit 4f26bd4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion AzzyBot-Next/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void AzzyBotServices(this IServiceCollection services)
services.AddSingleton<UpdaterService>();

services.AddSingleton<AzuraCastFileService>();
services.AddHostedService<AzuraCastFileServiceHost>();
services.AddHostedService<AzuraCastBackgroundServiceHost>();
services.AddSingleton<IQueuedBackgroundTask>(_ => new AzuraCastFileTask());

services.AddSingleton<TimerServiceHost>();
Expand Down
12 changes: 6 additions & 6 deletions AzzyBot-Next/Logging/LoggerActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ public static partial class LoggerActions
[LoggerMessage(3, LogLevel.Debug, "Global timer checking for AzuraCast files changes")]
public static partial void GlobalTimerCheckForAzuraCastFiles(this ILogger<TimerServiceHost> logger);

[LoggerMessage(10, LogLevel.Debug, "AzuraCastFileServiceHost started")]
public static partial void AzuraCastFileServiceHostStart(this ILogger<AzuraCastFileServiceHost> logger);
[LoggerMessage(10, LogLevel.Debug, "AzuraCastBackgroundServiceHost started")]
public static partial void AzuraCastBackgroundServiceHostStart(this ILogger<AzuraCastBackgroundServiceHost> logger);

[LoggerMessage(11, LogLevel.Debug, "AzuraCastBackgroundService started")]
public static partial void AzuraCastBackgroundServiceStart(this ILogger<AzuraCastBackgroundService> logger);

[LoggerMessage(12, LogLevel.Debug, "AzuraCastFileServiceHost running")]
public static partial void AzuraCastFileServiceHostRun(this ILogger<AzuraCastFileServiceHost> logger);
[LoggerMessage(12, LogLevel.Debug, "AzuraCastBackgroundServiceHost running")]
public static partial void AzuraCastBackgroundServiceHostRun(this ILogger<AzuraCastBackgroundServiceHost> logger);

[LoggerMessage(13, LogLevel.Debug, "Creating work items...")]
public static partial void AzuraCastFileServiceWorkItem(this ILogger<AzuraCastFileService> logger);

[LoggerMessage(90, LogLevel.Debug, "Stopping global timer")]
public static partial void GlobalTimerStop(this ILogger<TimerServiceHost> logger);

[LoggerMessage(91, LogLevel.Debug, "AzuraCastFileServiceHost stopped")]
public static partial void AzuraCastFileServiceHostStop(this ILogger<AzuraCastFileServiceHost> logger);
[LoggerMessage(91, LogLevel.Debug, "AzuraCastBackgroundServiceHost stopped")]
public static partial void AzuraCastBackgroundServiceHostStop(this ILogger<AzuraCastBackgroundServiceHost> logger);

[LoggerMessage(99, LogLevel.Debug, "Operation {ops} canceled by CancellationToken")]
public static partial void OperationCanceled(this ILogger logger, string ops);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@

namespace AzzyBot.Services.Modules;

public sealed class AzuraCastFileServiceHost(IQueuedBackgroundTask taskQueue, ILogger<AzuraCastFileServiceHost> logger, DiscordBotService discordBotService) : BackgroundService
public sealed class AzuraCastBackgroundServiceHost(ILogger<AzuraCastBackgroundServiceHost> logger, IQueuedBackgroundTask taskQueue, DiscordBotService discordBotService) : BackgroundService
{
private readonly ILogger<AzuraCastFileServiceHost> _logger = logger;
private readonly ILogger<AzuraCastBackgroundServiceHost> _logger = logger;
private readonly IQueuedBackgroundTask _taskQueue = taskQueue;
private readonly DiscordBotService _botService = discordBotService;

public override async Task StartAsync(CancellationToken cancellationToken)
{
_logger.AzuraCastFileServiceHostStart();
_logger.AzuraCastBackgroundServiceHostStart();

await base.StartAsync(cancellationToken);
}

protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
_logger.AzuraCastFileServiceHostRun();
_logger.AzuraCastBackgroundServiceHostRun();

return ProcessQueueAsync(stoppingToken);
}

public override async Task StopAsync(CancellationToken cancellationToken)
{
_logger.AzuraCastFileServiceHostStop();
_logger.AzuraCastBackgroundServiceHostStop();

await base.StopAsync(cancellationToken);
}
Expand Down

0 comments on commit 4f26bd4

Please sign in to comment.