feat: 轨迹拉取定时任务引入hangfire
This commit is contained in:
parent
2ae308b71e
commit
ecce6b62b4
@ -21,4 +21,9 @@ public class TrackAppOptions
|
|||||||
/// 轨迹运输时效预警通知跳转地址
|
/// 轨迹运输时效预警通知跳转地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WarningNotifyUrl { get; set; }
|
public string WarningNotifyUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹拉取任务间隔(分钟)
|
||||||
|
/// </summary>
|
||||||
|
public int TrackPullTaskMinuteInterval { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ using TrackCenter.Application.Hangfire;
|
|||||||
using TrackCenter.Application.HostServices;
|
using TrackCenter.Application.HostServices;
|
||||||
using TrackCenter.Application.Options;
|
using TrackCenter.Application.Options;
|
||||||
using TrackCenter.Application.Rabbit;
|
using TrackCenter.Application.Rabbit;
|
||||||
|
using TrackCenter.Application.Services.TimerTaskss;
|
||||||
|
|
||||||
namespace TrackCenter.Application;
|
namespace TrackCenter.Application;
|
||||||
|
|
||||||
@ -199,6 +200,11 @@ public class TrackCenterApplicationModule : FakeModule
|
|||||||
o.WorkerCount = 1;
|
o.WorkerCount = 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 轨迹拉取定时任务
|
||||||
|
RecurringJob.AddOrUpdate<TrackPullTask>("Execute_TrackPullTask",
|
||||||
|
x => x.RefreshForTaskAsync(),
|
||||||
|
$"*/{configuration["TrackApp:TrackPullTaskMinuteInterval"]} * * * *");
|
||||||
|
|
||||||
|
|
||||||
context.Services.AddHttpClient("itfx", client =>
|
context.Services.AddHttpClient("itfx", client =>
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user