File tree Expand file tree Collapse file tree
BotSharp.Abstraction/Crontab/Settings
BotSharp.Core.Crontab/Services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,9 +5,15 @@ public class CrontabSettings
55 public CrontabBaseSetting EventSubscriber { get ; set ; } = new ( ) ;
66 public CrontabBaseSetting Watcher { get ; set ; } = new ( ) ;
77 public string LockName { get ; set ; } = "CrontabWatcher:locker" ;
8+ public DebugSetting Debug { get ; set ; } = new ( ) ;
89}
910
1011public class CrontabBaseSetting
1112{
1213 public bool Enabled { get ; set ; } = true ;
1314}
15+
16+ public class DebugSetting
17+ {
18+ public string AllowRuleTrigger { get ; set ; } = "" ;
19+ }
Original file line number Diff line number Diff line change @@ -93,7 +93,10 @@ private async Task RunCronChecker(IServiceProvider services)
9393 _logger . LogInformation ( $ "The current time matches the cron expression { item } ") ;
9494
9595#if DEBUG
96- await HandleCrontabEvent ( item ) ;
96+ if ( item . Title == settings . Debug . AllowRuleTrigger )
97+ {
98+ await HandleCrontabEvent ( item ) ;
99+ }
97100#else
98101 if ( publisher != null )
99102 {
You can’t perform that action at this time.
0 commit comments