fix 调度时间调整
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Dlhis.ScheduledTask.SyncSapInfo.Job;
|
||||
using Hangfire;
|
||||
using Hangfire;
|
||||
using Hangfire.Dashboard.BasicAuthorization;
|
||||
using Hangfire.MySql;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
@@ -9,7 +8,7 @@ namespace Dlhis.ScheduledTask.Packs;
|
||||
|
||||
public class HangfirePack : BaseAppPack
|
||||
{
|
||||
public override int Order => 999;
|
||||
public override int Order => 990;
|
||||
|
||||
public override bool IsBeforeUseRouting { get; }
|
||||
|
||||
@@ -58,13 +57,5 @@ public class HangfirePack : BaseAppPack
|
||||
});
|
||||
|
||||
app.UseHangfireDashboard();
|
||||
|
||||
#region 周期任务
|
||||
//0:00
|
||||
RecurringJob.AddOrUpdate<SyncOrganizationJob>("SysSap", s => s.SyncOrgInfo(), "30 * * * * ?", new RecurringJobOptions
|
||||
{
|
||||
TimeZone = TimeZoneInfo.Local
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
28
Src/Dlhis.ScheduledTask/Packs/JobPack.cs
Normal file
28
Src/Dlhis.ScheduledTask/Packs/JobPack.cs
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user