fix 超时设置

This commit is contained in:
2024-11-28 14:57:39 +08:00
parent 2004035d9b
commit 971ef87957
7 changed files with 38 additions and 26 deletions

View File

@@ -9,17 +9,17 @@ namespace Dlhis.ScheduledTask.Jobs;
[RecurringJob(nameof(OutsourceAutoResignJob), "0 0 1 1/1 * ? ", Name = "自动处理外包离职")]
public class OutsourceAutoResignJob : BaseJob
{
private readonly IGainfoApi _gainfoApi;
private readonly ISyncApi _syncApi;
/// <inheritdoc />
public OutsourceAutoResignJob(IServiceProvider serviceProvider, IGainfoApi gainfoApi) : base(serviceProvider)
public OutsourceAutoResignJob(IServiceProvider serviceProvider, ISyncApi syncApi) : base(serviceProvider)
{
_gainfoApi = gainfoApi;
_syncApi = syncApi;
}
/// <inheritdoc />
protected override async Task RunAsync(IServiceProvider serviceProvider)
{
await _gainfoApi.OutsourceAutoResignAsync();
await _syncApi.OutsourceAutoResignAsync();
}
}

View File

@@ -26,13 +26,13 @@ public class SyncPersonJob : BaseJob
{
if (!werk.BackgroundJobKey.IsEmpty())
{
var jobKey = BackgroundJob.Enqueue<ISyncApi>(x => x.SyncGainfoByWerkAsync(werk.Werk));
werk.BackgroundJobKey = jobKey;
await DbContext.UpdateAsync(werk);
continue;
}
var jobKey = BackgroundJob.Enqueue<ISyncApi>(x => x.SyncGainfoByWerkAsync(werk.Werk));
werk.BackgroundJobKey = jobKey;
await DbContext.UpdateAsync(werk);
Logger.LogInformation("SAP创建人事范围{werk}后台调度任务", werk.Werk);
}
}