We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28c2f51 commit 65bcb28Copy full SHA for 65bcb28
apps/maxkb/settings/mem.py
@@ -10,10 +10,12 @@
10
# 1 hour
11
GC_INTERVAL = 3600
12
13
-def force_gc():
+def enable_force_gc():
14
collected = gc.collect()
15
maxkb_logger.debug(f"(PID: {CURRENT_PID}) Forced GC ({collected} objects collected)")
16
- threading.Timer(GC_INTERVAL - random.randint(0, 900), force_gc).start()
+ t = threading.Timer(GC_INTERVAL - random.randint(0, 900), force_gc)
17
+ t.daemon = True
18
+ t.start()
19
20
if CONFIG.get("ENABLE_MEMORY_OPTIMIZATION", '1') == "1":
21
+ enable_force_gc()
0 commit comments