diff --git a/.env.example b/.env.example index 7a991af..6b2b323 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,7 @@ [MONITOR] OFFLINE_THRESHOLD = 600 DATA_TIMEOUT = 259200 +RETENTION_TIME = 86400 [REDIS] HOST = '' diff --git a/application/common/lib/SystemMonitor.php b/application/common/lib/SystemMonitor.php index b6e0e5b..1bbc6d9 100644 --- a/application/common/lib/SystemMonitor.php +++ b/application/common/lib/SystemMonitor.php @@ -167,7 +167,7 @@ static public function setCollection($uuid, $data) Cache::store('redis')->handler() ->zAdd("system_monitor:collection:$uuid", time(), $data); Cache::store('redis')->handler() - ->zRemRangeByScore("system_monitor:collection:$uuid", 0, time() - Env::get("MONITOR.DATA_TIMEOUT")); + ->zRemRangeByScore("system_monitor:collection:$uuid", 0, time() - Env::get("MONITOR.RETENTION_TIME")); Cache::store('redis')->handler()->expire("system_monitor:collection:$uuid", Env::get("MONITOR.DATA_TIMEOUT")); return ['code' => 200, 'message' => "OK"]; } catch (Exception $e) {