暂时先屏蔽后台队列,使用原有Hanfire

parent 08a32b60
...@@ -197,17 +197,17 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A ...@@ -197,17 +197,17 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
} }
else else
{ {
//BackgroundJob.Schedule(() => _allotService.Generate(allot, email), TimeSpan.FromSeconds(1)); BackgroundJob.Schedule(() => _allotService.Generate(allot, email), TimeSpan.FromSeconds(1));
_backgroundTaskQueue.QueueBackgroundWorkItem(async token => //_backgroundTaskQueue.QueueBackgroundWorkItem(async token =>
{ //{
using (var scope = _serviceScopeFactory.CreateScope()) // using (var scope = _serviceScopeFactory.CreateScope())
{ // {
var scopedServices = scope.ServiceProvider.GetRequiredService<AllotService>(); // var scopedServices = scope.ServiceProvider.GetRequiredService<AllotService>();
scopedServices.Generate(allot, email); // scopedServices.Generate(allot, email);
await Task.Delay(TimeSpan.FromSeconds(5), token); // await Task.Delay(TimeSpan.FromSeconds(5), token);
} // }
}); //});
} }
logManageService.WriteMsg("等待绩效生成", $"等待绩效生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage"); logManageService.WriteMsg("等待绩效生成", $"等待绩效生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment