Skip to content

Commit e3e9d3e

Browse files
committed
Independent cache const for server response time
1 parent 6e0a42e commit e3e9d3e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libraries/ServerMetric.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313

1414
class ServerMetric {
1515

16-
const CACHE_UPTIME_TTL = 300;
16+
const CACHE_RESPONSE_TIME_TTL = 300;
17+
const CACHE_UPTIME_TTL = 300;
1718

1819
public static function getLatestResponseTime($server_id) {
19-
$cache_key = "bnetdocs-servermetric-lastms-" . (int) $server_id;
20+
$cache_key = "bnetdocs-servermetric-responsetime-" . (int) $server_id;
2021
$cache_val = Common::$cache->get($cache_key);
2122
if ($cache_val !== false) return $cache_val;
2223
if (!isset(Common::$database)) {
@@ -35,7 +36,7 @@ public static function getLatestResponseTime($server_id) {
3536
Common::$cache->set(
3637
$cache_key,
3738
$obj->response_time,
38-
self::CACHE_UPTIME_TTL
39+
self::CACHE_RESPONSE_TIME_TTL
3940
);
4041
return $obj->response_time;
4142
}

0 commit comments

Comments
 (0)