diff --git a/YD_AllHeartRates.Api/Mqtt/MqttBackgroundService.cs b/YD_AllHeartRates.Api/Mqtt/MqttBackgroundService.cs index 39b4c02..1a2f43d 100644 --- a/YD_AllHeartRates.Api/Mqtt/MqttBackgroundService.cs +++ b/YD_AllHeartRates.Api/Mqtt/MqttBackgroundService.cs @@ -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(); @@ -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); } } diff --git a/YD_AllHeartRates.Api/Mqtt/MqttBackgroundService2.cs b/YD_AllHeartRates.Api/Mqtt/MqttBackgroundService2.cs index 629b447..e74a478 100644 --- a/YD_AllHeartRates.Api/Mqtt/MqttBackgroundService2.cs +++ b/YD_AllHeartRates.Api/Mqtt/MqttBackgroundService2.cs @@ -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); // 记录活跃学生编号(便于定时入库)