修复卡轮训的问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m14s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m14s
This commit is contained in:
@@ -46,6 +46,14 @@ func (b *PollingBase) updateCardCache(ctx context.Context, cardID uint, updates
|
||||
}
|
||||
}
|
||||
|
||||
// invalidateCardCache 删除轮询卡缓存,确保后续从数据库重建
|
||||
func (b *PollingBase) invalidateCardCache(ctx context.Context, cardID uint) {
|
||||
key := constants.RedisPollingCardInfoKey(cardID)
|
||||
if err := b.redis.Del(ctx, key).Err(); err != nil {
|
||||
b.logger.Warn("删除卡缓存失败", zap.Uint("card_id", cardID), zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
// parseCardFromCache 从 Redis Hash 反序列化卡信息
|
||||
func parseCardFromCache(cardID uint, result map[string]string) *model.IotCard {
|
||||
card := &model.IotCard{}
|
||||
|
||||
Reference in New Issue
Block a user