fix 处理同步时间,调整到5点
This commit is contained in:
@@ -48,7 +48,7 @@ public class BalanceRecordUploadBackgroundService : BackgroundService
|
||||
var balanceRecords = await db.Queryable<LocalBalanceRecordEntity>()
|
||||
.Where(x => x.TenantId == factory)
|
||||
.Where(x => !x.IsSync).ToListAsync(stoppingToken);
|
||||
|
||||
|
||||
if (balanceRecords.Any())
|
||||
{
|
||||
_logger.LogInformation("上传离线订单");
|
||||
@@ -104,24 +104,12 @@ public class BalanceRecordUploadBackgroundService : BackgroundService
|
||||
|
||||
try
|
||||
{
|
||||
if (now is { Hour: 4, Minute: 1 }
|
||||
if (now is { Hour: 5, Minute: 1 }
|
||||
&& !_healthCheckService.GetIsOffline()
|
||||
&& !await db.Queryable<LocalBalanceRecordEntity>().Where(x => !x.IsSync).AnyAsync())
|
||||
{
|
||||
await ds.InitAsync(factories);
|
||||
}
|
||||
else if (now is { Hour: 15, Minute: 1 }
|
||||
&& !_healthCheckService.GetIsOffline()
|
||||
&& !await db.Queryable<LocalBalanceRecordEntity>().Where(x => !x.IsSync).AnyAsync())
|
||||
{
|
||||
await ds.InitAsync(factories);
|
||||
}
|
||||
else if (now is { Hour: 20, Minute: 1 }
|
||||
&& !_healthCheckService.GetIsOffline()
|
||||
&& !await db.Queryable<LocalBalanceRecordEntity>().Where(x => !x.IsSync).AnyAsync())
|
||||
{
|
||||
await ds.InitAsync(factories);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user