mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 02:35:14 +00:00
Cleaning up added gc's
This commit is contained in:
parent
7c809931d7
commit
6087ecadf0
2 changed files with 40 additions and 69 deletions
|
|
@ -254,6 +254,7 @@ def cleanup_memory(log_usage=True, force_collection=True):
|
|||
log_usage: Whether to log memory usage before and after cleanup
|
||||
force_collection: Whether to force garbage collection
|
||||
"""
|
||||
logger.debug("Starting memory cleanup django memory cleanup")
|
||||
if log_usage:
|
||||
try:
|
||||
import psutil
|
||||
|
|
@ -282,3 +283,4 @@ def cleanup_memory(log_usage=True, force_collection=True):
|
|||
logger.debug(f"Memory after cleanup: {after_mem:.2f} MB (change: {after_mem-before_mem:.2f} MB)")
|
||||
except (ImportError, Exception):
|
||||
pass
|
||||
logger.debug("Memory cleanup complete for django")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue