Skip to content

Commit 98eb763

Browse files
authored
Merge pull request #858 from hchen2020/master
Add IsRealTime Flag
2 parents d9b349f + 2e00e7b commit 98eb763

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/Infrastructure/BotSharp.Core.Crontab/Abstraction/ICrontabSource.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@ namespace BotSharp.Core.Crontab.Abstraction;
55
/// </summary>
66
public interface ICrontabSource
77
{
8+
/// <summary>
9+
/// Set to true if the cron is real-time like Change Data Capture (CDC).
10+
/// </summary>
11+
bool IsRealTime => false;
12+
813
CrontabItem GetCrontabItem();
914
}

src/Infrastructure/BotSharp.Core.Crontab/Services/CrontabService.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public async Task<List<CrontabItem>> GetCrontable()
5151
var cronsources = _services.GetServices<ICrontabSource>();
5252
foreach (var source in cronsources)
5353
{
54+
if (source.IsRealTime)
55+
{
56+
continue;
57+
}
5458
var item = source.GetCrontabItem();
5559
fixedCrantabItems.Add(source.GetCrontabItem());
5660
}

src/Infrastructure/BotSharp.Core.Crontab/Services/CrontabWatcher.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ private async Task RunCronChecker(IServiceProvider services)
4545
{
4646
var cron = services.GetRequiredService<ICrontabService>();
4747
var crons = await cron.GetCrontable();
48-
4948
var publisher = services.GetService<IEventPublisher>();
5049

5150
foreach (var item in crons)

0 commit comments

Comments
 (0)