fix db closure

This commit is contained in:
2025-05-17 23:41:19 +02:00
parent 2b9d37cc2f
commit e4b0c9cbc4
3 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@@ -142,8 +142,7 @@ def get_info():
cpu_percent = psutil.cpu_percent(interval=0.5)
ram_percent = psutil.virtual_memory().percent
disk_percent = psutil.disk_usage('/').percent
db.close()
system_information = Info(
uptime=datetime.datetime.now() - datetime.timedelta(seconds=delta_seconds),
cpu=cpu_percent,
@@ -166,6 +165,7 @@ def get_limits():
if not limits:
db.close()
raise HTTPException(status_code=404, detail="Limits not found")
db.close()
return {
"cpu_threshold": limits.cpu_threshold,
"ram_threshold": limits.ram_threshold,

Binary file not shown.