Skip to content

Commit

Permalink
Move registration for TimeProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
austins committed Oct 7, 2024
1 parent 35f9f06 commit cf3bc5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/DiscordTranslationBot/Jobs/JobExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
namespace DiscordTranslationBot.Jobs;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace DiscordTranslationBot.Jobs;

internal static class JobExtensions
{
public static IServiceCollection AddJobs(this IServiceCollection services)
{
services.TryAddSingleton(TimeProvider.System);

return services.AddSingleton<IScheduler, Scheduler>().AddHostedService<SchedulerBackgroundService>();
}
}
1 change: 0 additions & 1 deletion src/DiscordTranslationBot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// Main services.
builder
.Services
.AddSingleton(TimeProvider.System)
.AddTranslationProviders(builder.Configuration)
.AddSingleton<IDiscordClient>(
_ => new DiscordSocketClient(
Expand Down

0 comments on commit cf3bc5b

Please sign in to comment.