Update app.py
Browse files
app.py
CHANGED
|
@@ -173,7 +173,7 @@ def cleanup_old_files():
|
|
| 173 |
# Удаляем директории старше 1 часа
|
| 174 |
stat = item.stat()
|
| 175 |
dir_age = current_time - stat.st_ctime
|
| 176 |
-
if dir_age >
|
| 177 |
shutil.rmtree(item, ignore_errors=True)
|
| 178 |
logger.info(f"Cleaned up old directory: {item}")
|
| 179 |
except Exception as e:
|
|
@@ -231,7 +231,7 @@ if __name__ == "__main__":
|
|
| 231 |
def cleanup_thread():
|
| 232 |
while True:
|
| 233 |
cleanup_old_files()
|
| 234 |
-
time.sleep(
|
| 235 |
|
| 236 |
cleanup_thread = threading.Thread(target=cleanup_thread, daemon=True)
|
| 237 |
cleanup_thread.start()
|
|
|
|
| 173 |
# Удаляем директории старше 1 часа
|
| 174 |
stat = item.stat()
|
| 175 |
dir_age = current_time - stat.st_ctime
|
| 176 |
+
if dir_age > 600:
|
| 177 |
shutil.rmtree(item, ignore_errors=True)
|
| 178 |
logger.info(f"Cleaned up old directory: {item}")
|
| 179 |
except Exception as e:
|
|
|
|
| 231 |
def cleanup_thread():
|
| 232 |
while True:
|
| 233 |
cleanup_old_files()
|
| 234 |
+
time.sleep(600) # Каждый час
|
| 235 |
|
| 236 |
cleanup_thread = threading.Thread(target=cleanup_thread, daemon=True)
|
| 237 |
cleanup_thread.start()
|