Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import json
|
|
| 4 |
import re
|
| 5 |
import logging
|
| 6 |
import time
|
|
|
|
| 7 |
from typing import List, Dict, Optional, Union
|
| 8 |
from datetime import datetime, time as dt_time
|
| 9 |
import pytz
|
|
@@ -944,7 +945,7 @@ def cleanup_session():
|
|
| 944 |
except Exception as e:
|
| 945 |
logger.warning(f"⚠️ Error during cleanup: {e}")
|
| 946 |
|
| 947 |
-
|
| 948 |
|
| 949 |
def cleanup_session():
|
| 950 |
"""Cleanup session on exit."""
|
|
|
|
| 4 |
import re
|
| 5 |
import logging
|
| 6 |
import time
|
| 7 |
+
import atexit
|
| 8 |
from typing import List, Dict, Optional, Union
|
| 9 |
from datetime import datetime, time as dt_time
|
| 10 |
import pytz
|
|
|
|
| 945 |
except Exception as e:
|
| 946 |
logger.warning(f"⚠️ Error during cleanup: {e}")
|
| 947 |
|
| 948 |
+
atexit.register(cleanup_session) atexit
|
| 949 |
|
| 950 |
def cleanup_session():
|
| 951 |
"""Cleanup session on exit."""
|