fix db closure
This commit is contained in:
Binary file not shown.
4
main.py
4
main.py
@@ -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,
|
||||
|
||||
BIN
wall_messages.db
BIN
wall_messages.db
Binary file not shown.
Reference in New Issue
Block a user