add crontab debug config
This commit is contained in:
parent
ae2b5e2287
commit
bdaf3cc6b3
|
|
@ -4,9 +4,15 @@ 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 DebugSetting Debug { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CrontabBaseSetting
|
public class CrontabBaseSetting
|
||||||
{
|
{
|
||||||
public bool Enabled { get; set; } = true;
|
public bool Enabled { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DebugSetting
|
||||||
|
{
|
||||||
|
public string AllowRuleTrigger { get; set; } = "";
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,10 @@ public class CrontabWatcher : BackgroundService
|
||||||
_logger.LogInformation($"The current time matches the cron expression {item}");
|
_logger.LogInformation($"The current time matches the cron expression {item}");
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
await HandleCrontabEvent(item);
|
if (item.Title == settings.Debug.AllowRuleTrigger)
|
||||||
|
{
|
||||||
|
await HandleCrontabEvent(item);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (publisher != null)
|
if (publisher != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue