Update lockname to default if not provided.
This commit is contained in:
parent
e4c53a32b5
commit
4a1439574d
|
|
@ -4,7 +4,7 @@ public class CrontabSettings
|
||||||
{
|
{
|
||||||
public CrontabBaseSetting EventSubscriber { get; set; } = new();
|
public CrontabBaseSetting EventSubscriber { get; set; } = new();
|
||||||
public CrontabBaseSetting Watcher { get; set; } = new();
|
public CrontabBaseSetting Watcher { get; set; } = new();
|
||||||
public string LockName { get; set; }
|
public string LockName { get; set; } = "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CrontabBaseSetting
|
public class CrontabBaseSetting
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ public class CrontabWatcher : BackgroundService
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_services = services;
|
_services = services;
|
||||||
_cronSettings = cronSettings;
|
_cronSettings = cronSettings;
|
||||||
DIST_KEY = $"CrontabWatcher:locker-{_cronSettings.LockName ?? "default"}";
|
DIST_KEY = $"CrontabWatcher:locker-{_cronSettings.LockName}";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue