File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/Infrastructure/BotSharp.Core.Crontab/Services Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ private async Task RunCronChecker(IServiceProvider services)
4545 {
4646 var cron = services . GetRequiredService < ICrontabService > ( ) ;
4747 var crons = await cron . GetCrontable ( ) ;
48+ var settings = services . GetRequiredService < CrontabSettings > ( ) ;
4849 var publisher = services . GetService < IEventPublisher > ( ) ;
4950
5051 foreach ( var item in crons )
@@ -87,7 +88,7 @@ private async Task RunCronChecker(IServiceProvider services)
8788 {
8889 _logger . LogInformation ( $ "The current time matches the cron expression { item } ") ;
8990
90- if ( publisher != null )
91+ if ( publisher != null && settings . EventSubscriber . Enabled )
9192 {
9293 await publisher . PublishAsync ( $ "Crontab:{ item . Title } ", item . Cron ) ;
9394 }
You can’t perform that action at this time.
0 commit comments