opt:优化轨迹刷新定时任务等待超时问题

This commit is contained in:
李鹏军 2024-05-14 17:17:14 +08:00
parent 7482521e75
commit 4b0acb1978

View File

@ -78,9 +78,12 @@ public class TrackPullService : ApplicationService
/// <returns></returns> /// <returns></returns>
[AllowAnonymous] [AllowAnonymous]
[HttpPost("Track/RefreshForTask")] [HttpPost("Track/RefreshForTask")]
public async Task<bool> RefreshForTaskAsync() public bool RefreshForTaskAsync()
{
Task.Run(async () =>
{ {
var configs = await _trackPullCacheService.GetAllPullConfigsAsync(); var configs = await _trackPullCacheService.GetAllPullConfigsAsync();
foreach (var config in configs) foreach (var config in configs)
{ {
var redisKey = _trackPullCacheService.TrackPullKey(config.SubSystemId, config.ServiceProviderId); var redisKey = _trackPullCacheService.TrackPullKey(config.SubSystemId, config.ServiceProviderId);
@ -118,6 +121,7 @@ public class TrackPullService : ApplicationService
await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count); await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count);
} }
});
return true; return true;
} }