| | |
| | | using Microsoft.Extensions.Hosting; |
| | | using Microsoft.Extensions.Logging; |
| | | using Microsoft.Extensions.Options; |
| | | using System; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Core; |
| | | using WIDESEA_ITaskInfoService; |
| | | |
| | |
| | | |
| | | _logger.LogInformation("自动出库任务检查间隔: {Seconds} 秒", _options.CheckIntervalSeconds); |
| | | |
| | | int index = 0; |
| | | |
| | | while (!stoppingToken.IsCancellationRequested) |
| | | { |
| | | try |
| | | { |
| | | _logger.LogDebug("开始检查到期库存..."); |
| | | _logger.LogInformation("开始检查到期库存..."); |
| | | if (index == 0) |
| | | { |
| | | await Task.Delay(5000, stoppingToken); |
| | | index++; |
| | | } |
| | | var result = await _taskService.CreateAutoOutboundTasksAsync(); |
| | | |
| | | if (result.Status) |
| | |
| | | await base.StopAsync(cancellationToken); |
| | | } |
| | | } |
| | | } |
| | | } |