This commit is contained in:
tanglong 2025-07-28 15:31:34 +08:00
parent e4b9113836
commit a15af967e2
2 changed files with 4 additions and 4 deletions

View File

@ -123,8 +123,8 @@ namespace YD_AllHeartRates.Api.Mqtt
devices = _smartSportsContext.Device.Where(x => x.SchoolCode == AppSettings.SchoolCode && !string.IsNullOrWhiteSpace(x.StudentNo)).ToList();
_caching.AddObject(studentListCacheKey, studentList, 28800);
_caching.AddObject(deviceListCacheKey, devices, 28800);
_caching.AddObject(studentListCacheKey, studentList, 600);
_caching.AddObject(deviceListCacheKey, devices, 600);
}
var heartRateEntities = new ConcurrentBag<HeartRateData>();
@ -256,7 +256,7 @@ namespace YD_AllHeartRates.Api.Mqtt
totalData.QuantityOfElectricity = jumpData.QuantityOfElectricity;
totalData.ScoreTime = jumpData.ScoreTime;
_caching.AddObject(jumpKey, totalData, 28800);
_caching.AddObject(jumpKey, totalData, 600);
_caching.AddObject(rawKey, jumpData, 60);
}
}

View File

@ -256,7 +256,7 @@ namespace YD_AllHeartRates.Api.Mqtt
totalData.ScoreTime = jumpData.ScoreTime;
// 写入缓存(总值 + 原始值)
_caching.AddObject(jumpKey, totalData, 28800);
_caching.AddObject(jumpKey, totalData, 600);
_caching.AddObject(rawKey, jumpData, 60);
// 记录活跃学生编号(便于定时入库)