remove redis dependency from CrontabEventSubscription
This commit is contained in:
parent
15a30f2670
commit
aef830deba
|
|
@ -21,7 +21,11 @@ public class CrontabEventSubscription : BackgroundService
|
|||
|
||||
using (var scope = _services.CreateScope())
|
||||
{
|
||||
var publisher = scope.ServiceProvider.GetRequiredService<IEventPublisher>();
|
||||
var publisher = scope.ServiceProvider.GetService<IEventPublisher>();
|
||||
if (publisher == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var subscriber = scope.ServiceProvider.GetRequiredService<IEventSubscriber>();
|
||||
var cron = scope.ServiceProvider.GetRequiredService<ICrontabService>();
|
||||
var crons = await cron.GetCrontable();
|
||||
|
|
@ -46,19 +50,5 @@ public class CrontabEventSubscription : BackgroundService
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*using (var scope = _services.CreateScope())
|
||||
{
|
||||
var cron = scope.ServiceProvider.GetRequiredService<ICrontabService>();
|
||||
var crons = await cron.GetCrontable();
|
||||
|
||||
|
||||
|
||||
while (!stoppingToken.IsCancellationRequested)
|
||||
{
|
||||
await Task.Delay(1000, stoppingToken);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class DistributedLocker : IDistributedLocker
|
|||
var redis = _services.GetService<IConnectionMultiplexer>();
|
||||
if (redis == null)
|
||||
{
|
||||
_logger.LogWarning($"The Redis server is experiencing issues and is not functioning as expected.");
|
||||
_logger.LogInformation($"The Redis server is experiencing issues and is not functioning as expected.");
|
||||
await action();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue