产生新的批次的时候,重新计算

This commit is contained in:
yanghongwei 2025-04-04 19:49:50 +08:00
parent d003bb14e5
commit 0954cb5738
1 changed files with 2 additions and 1 deletions

View File

@ -67,7 +67,7 @@ namespace LY.App.Service
await _db.CopyNew().Insertable(entity).SplitTable().ExecuteReturnSnowflakeIdListAsync(); await _db.CopyNew().Insertable(entity).SplitTable().ExecuteReturnSnowflakeIdListAsync();
//推送报警信息 //推送报警信息
await _pushService.SendMessageToAll(new { msgType = "event", data = entity }); await _pushService.SendMessageToAll(new { msgType = "event", data = entity });
await _redisService.DeleteAsync(RedisKeyList.index_data());
} }
return new ApiResult(); return new ApiResult();
} }
@ -141,6 +141,7 @@ namespace LY.App.Service
if (batchId == 0) if (batchId == 0)
{ {
batchId = SnowFlakeSingle.Instance.NextId(); batchId = SnowFlakeSingle.Instance.NextId();
await _redisService.DeleteAsync(RedisKeyList.index_data());
} }
await _redisService.SetAsync(key, batchId, TimeSpan.FromSeconds(timeSpan)); await _redisService.SetAsync(key, batchId, TimeSpan.FromSeconds(timeSpan));
return batchId; return batchId;