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("SyncSap", s => s.SyncOrgInfo(), "30 * * * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); #else RecurringJob.AddOrUpdate("SyncSap", s => s.SyncOrgInfo(), "0 0 2 * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); #endif } }