refine code
This commit is contained in:
parent
d19a4e1aaf
commit
19e957ef25
|
|
@ -7,9 +7,7 @@ public interface ICrontabHook : IHookBase
|
|||
string[]? Triggers
|
||||
=> null;
|
||||
|
||||
void OnAuthenticate(CrontabItem item)
|
||||
{
|
||||
}
|
||||
void OnAuthenticate(CrontabItem item) { }
|
||||
|
||||
Task OnCronTriggered(CrontabItem item)
|
||||
=> Task.CompletedTask;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class CrontabService : ICrontabService, ITaskFeeder
|
|||
continue;
|
||||
}
|
||||
var item = source.GetCrontabItem();
|
||||
fixedCrantabItems.Add(source.GetCrontabItem());
|
||||
fixedCrantabItems.Add(item);
|
||||
}
|
||||
|
||||
return fixedCrantabItems;
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ public class CrontabWatcher : BackgroundService
|
|||
{
|
||||
_logger.LogInformation($"The current time matches the cron expression {item}");
|
||||
|
||||
#if DEBUG
|
||||
await HandleCrontabEvent(item);
|
||||
#else
|
||||
if (publisher != null)
|
||||
{
|
||||
await publisher.PublishAsync($"Crontab:{item.Title}", item.Cron);
|
||||
|
|
@ -95,6 +98,7 @@ public class CrontabWatcher : BackgroundService
|
|||
{
|
||||
await HandleCrontabEvent(item);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -11,8 +11,11 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Helpers\**" />
|
||||
<Compile Remove="packages\**" />
|
||||
<EmbeddedResource Remove="Helpers\**" />
|
||||
<EmbeddedResource Remove="packages\**" />
|
||||
<None Remove="Helpers\**" />
|
||||
<None Remove="packages\**" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
@ -108,8 +111,4 @@
|
|||
<ProjectReference Include="..\..\Infrastructure\BotSharp.Core\BotSharp.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Helpers\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in a new issue