Enhance error handling in backup cleanup process. Added a generic exception handler to log errors during the removal of old backups, improving robustness and maintainability of the backup functionality.

This commit is contained in:
Zakhar Izmaylov
2025-01-23 12:10:08 +03:00
+2
View File
@@ -97,6 +97,8 @@ def _cleanup_old_backups():
logger.info("Старые бэкапы удалены.")
except subprocess.CalledProcessError as e:
logger.error(f"Ошибка при удалении старых бэкапов: {e}")
except Exception as e:
logger.error(f"Ошибка при удалении старых бэкапов: {e}")
async def create_backup_and_send_to_admins(xui):