]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Log mtime for removed files in internal tempdir
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 30 Mar 2025 09:06:33 +0000 (11:06 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 30 Mar 2025 09:07:45 +0000 (11:07 +0200)
src/ccache/storage/local/localstorage.cpp

index 89a51a02a1775e6a32bfb98f3de5218b4cb6d5f5..4b13a4a3837956a767308972e0177951375776f7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021-2024 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2025 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -1465,7 +1465,13 @@ LocalStorage::clean_internal_tempdir()
       return;
     }
     if (de && de.mtime() + k_tempdir_cleanup_interval < now) {
-      util::remove(de.path());
+      LOG("Removing {} (mtime: {})",
+          de.path(),
+          util::format_iso8601_timestamp(de.mtime()));
+      auto result = fs::remove(de.path());
+      if (!result) {
+        LOG("Removal failed: {}", result.error().message());
+      }
     }
   }).or_else([&](const auto& error) {
     LOG("Failed to clean up {}: {}", m_config.temporary_dir(), error);