From a15af967e2dd98f88c113b78a7bd304a4d3c0593 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Mon, 28 Jul 2025 15:31:34 +0800 Subject: [PATCH] dd --- YD_AllHeartRates.Api/Mqtt/MqttBackgroundService.cs | 6 +++--- YD_AllHeartRates.Api/Mqtt/MqttBackgroundService2.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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); // 记录活跃学生编号(便于定时入库)