Skip to content

Commit a60926b

Browse files
committed
修复system.py会找不到key的情况,更新版本至1.10.5
1 parent 0ff903b commit a60926b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

core/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
CACHE_BUFFER_COMPRESSION_MIN_LENGTH: int = 64
2121
DEBUG: bool = Config.get("advanced.debug")
2222
ROOT = os.getcwd()
23-
API_VERSION = "1.10.4"
23+
API_VERSION = "1.10.5"
2424
USER_AGENT = f"openbmclapi-cluster/{API_VERSION} python-openbmclapi/{VERSION}"
2525
BASE_URL = Config.get("advanced.url", "https://openbmclapi.bangbang93.com/")
2626
BD_URL = BASE_URL.replace("openbmclapi", "bd")

core/system.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ def _run():
1717
global cpus, memories, connections, length, last_curs
1818
for _ in range(max(length - 60, 0)):
1919
cur = last_curs.pop(0)
20-
cpus.pop(cur)
21-
memories.pop(cur)
22-
connections.pop(cur)
20+
if cur in cpus:
21+
cpus.pop(cur)
22+
if cur in memories:
23+
memories.pop(cur)
24+
if cur in connections:
25+
connections.pop(cur)
2326
length -= 1
2427
cur = get_uptime()
2528
cpus[cur] = process.cpu_percent(1)

0 commit comments

Comments
 (0)