File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
BotSharp.Abstraction/Crontab/Settings
BotSharp.Core.Crontab/Services Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,15 @@ public class CrontabSettings
5
5
public CrontabBaseSetting EventSubscriber { get ; set ; } = new ( ) ;
6
6
public CrontabBaseSetting Watcher { get ; set ; } = new ( ) ;
7
7
public string LockName { get ; set ; } = "CrontabWatcher:locker" ;
8
+ public DebugSetting Debug { get ; set ; } = new ( ) ;
8
9
}
9
10
10
11
public class CrontabBaseSetting
11
12
{
12
13
public bool Enabled { get ; set ; } = true ;
13
14
}
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)
93
93
_logger . LogInformation ( $ "The current time matches the cron expression { item } ") ;
94
94
95
95
#if DEBUG
96
- await HandleCrontabEvent ( item ) ;
96
+ if ( item . Title == settings . Debug . AllowRuleTrigger )
97
+ {
98
+ await HandleCrontabEvent ( item ) ;
99
+ }
97
100
#else
98
101
if ( publisher != null )
99
102
{
You can’t perform that action at this time.
0 commit comments