From f0fd179fbc01b1ac1e8b878c5ac15b4d6e3bf0e0 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 14 Nov 2024 16:51:46 +0000 Subject: [PATCH] Code format - (Clang-format) --- src/database/database.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/database/database.cpp b/src/database/database.cpp index dc58794e6af..9e1d81025da 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -140,20 +140,20 @@ void Database::createDatabaseBackup(bool compress) const { // Delete old backups auto twentyFourHoursAgo = std::chrono::system_clock::now() - std::chrono::hours(24); auto sevenDaysAgo = std::chrono::system_clock::now() - std::chrono::hours(24 * 7); - for (const auto& entry : std::filesystem::directory_iterator("database_backup")) { + for (const auto &entry : std::filesystem::directory_iterator("database_backup")) { if (entry.is_directory()) { try { auto dirTime = std::filesystem::last_write_time(entry); if (dirTime.time_since_epoch() < sevenDaysAgo.time_since_epoch()) { // Instead of deleting the entire directory, delete only specific files - for (const auto& file : std::filesystem::directory_iterator(entry)) { + for (const auto &file : std::filesystem::directory_iterator(entry)) { if (file.path().extension() == ".gz" || file.path().extension() == ".sql") { std::filesystem::remove(file); g_logger().info("Deleted old backup file: {}", file.path().string()); } } } - } catch (const std::filesystem::filesystem_error& e) { + } catch (const std::filesystem::filesystem_error &e) { g_logger().error("Failed to check or delete files in backup directory: {}. Error: {}", entry.path().string(), e.what()); } }