diff --git a/Workers/TriliumWorker.cs b/Workers/TriliumWorker.cs index e61c6a1..b681778 100644 --- a/Workers/TriliumWorker.cs +++ b/Workers/TriliumWorker.cs @@ -11,16 +11,13 @@ public class TriliumWorker : BackgroundService { private readonly Serilog.ILogger _log; private readonly AppConfigs _config; - private readonly IServiceScopeFactory _scopeFactory; // Singleton services cannot directly inject Scoped services. private readonly TriliumService _triliumService; private readonly Channel _issueChannel; - public TriliumWorker(AppConfigs configs, IServiceScopeFactory serviceScopeFactory, - TriliumService triliumService, Channel issueChannel) + public TriliumWorker(AppConfigs configs, TriliumService triliumService, Channel issueChannel) { _log = Log.ForContext(); _config = configs; - _scopeFactory = serviceScopeFactory; _triliumService = triliumService; _issueChannel = issueChannel; } @@ -30,15 +27,6 @@ public class TriliumWorker : BackgroundService while (!stoppingToken.IsCancellationRequested) { _log.Debug("Worker running at: {time}", DateTimeOffset.Now); - - using var scope = _scopeFactory.CreateScope(); - var db = scope.ServiceProvider.GetRequiredService(); - var unpublishedIssues = await db.GetUnpublishedJiraIssuesAsync(stoppingToken); - if (unpublishedIssues != null) - { - // Publish or update Trilium notes - } - await Task.Delay(10 *1000, stoppingToken); } }