fix 调度时间调整

This commit is contained in:
2024-01-19 10:29:13 +08:00
parent ce8f64fee3
commit 0ae4737c0f
2 changed files with 30 additions and 11 deletions

View File

@@ -0,0 +1,28 @@
using Dlhis.ScheduledTask.SyncSapInfo.Job;
using Hangfire;
using Kurisu.AspNetCore.Startup;
namespace Dlhis.ScheduledTask.Packs;
public class JobPack : BaseAppPack
{
public override int Order => 999;
public override bool IsBeforeUseRouting { get; }
public override void Invoke(IServiceProvider serviceProvider)
{
#if DEBUG
RecurringJob.AddOrUpdate<SyncOrganizationJob>("SyncSap", s => s.SyncOrgInfo(), "30 * * * * ?", new RecurringJobOptions
{
TimeZone = TimeZoneInfo.Local
});
#else
RecurringJob.AddOrUpdate<SyncOrganizationJob>("SyncSap", s => s.SyncOrgInfo(), "0 0 2 * * ?", new RecurringJobOptions
{
TimeZone = TimeZoneInfo.Local
});
#endif
}
}