29 lines
757 B
C#
29 lines
757 B
C#
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
|
|
}
|
|
}
|