diff options
| author | Dan Engelbrecht <[email protected]> | 2023-05-11 00:20:17 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-11 00:20:17 +0200 |
| commit | b6b2bffdac4f5a0ad996d2014e57dc2aa2aff1fd (patch) | |
| tree | 414ad99331acecb4742eaf68f3ac1982c16184b5 /src | |
| parent | Revert "add timeout to server spawns in tests" (diff) | |
| download | zen-b6b2bffdac4f5a0ad996d2014e57dc2aa2aff1fd.tar.xz zen-b6b2bffdac4f5a0ad996d2014e57dc2aa2aff1fd.zip | |
WARN level log if we can't write snapshot/manifest/access times (#288)
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/cache/structuredcachestore.cpp | 11 | ||||
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 15 | ||||
| -rw-r--r-- | src/zenstore/compactcas.cpp | 2 |
3 files changed, 21 insertions, 7 deletions
diff --git a/src/zenserver/cache/structuredcachestore.cpp b/src/zenserver/cache/structuredcachestore.cpp index d4e00d675..79f57019d 100644 --- a/src/zenserver/cache/structuredcachestore.cpp +++ b/src/zenserver/cache/structuredcachestore.cpp @@ -841,7 +841,7 @@ ZenCacheDiskLayer::CacheBucket::MakeIndexSnapshot() } catch (std::exception& Err) { - ZEN_ERROR("snapshot FAILED, reason: '{}'", Err.what()); + ZEN_WARN("snapshot FAILED, reason: '{}'", Err.what()); // Restore any previous snapshot @@ -1285,7 +1285,14 @@ ZenCacheDiskLayer::CacheBucket::SaveManifest() Writer.EndArray(); } - SaveCompactBinaryObject(m_BucketDir / "zen_manifest", Writer.Save()); + try + { + SaveCompactBinaryObject(m_BucketDir / "zen_manifest", Writer.Save()); + } + catch (std::exception& Err) + { + ZEN_WARN("writing manifest FAILED, reason: '{}'", Err.what()); + } } void diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index 9dd6ddcfc..7fd9bcae0 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -1366,10 +1366,17 @@ ProjectStore::Project::WriteAccessTimes() ZEN_INFO("persisting access times for project '{}' to {}", Identifier, ProjectAccessTimesFilePath); - BasicFile Blob; - Blob.Open(ProjectAccessTimesFilePath, BasicFile::Mode::kTruncate); - Blob.Write(Mem.Data(), Mem.Size(), 0); - Blob.Flush(); + try + { + BasicFile Blob; + Blob.Open(ProjectAccessTimesFilePath, BasicFile::Mode::kTruncate); + Blob.Write(Mem.Data(), Mem.Size(), 0); + Blob.Flush(); + } + catch (std::exception& Err) + { + ZEN_WARN("writing access times FAILED, reason: '{}'", Err.what()); + } } spdlog::logger& diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp index 275410ae6..c513aa132 100644 --- a/src/zenstore/compactcas.cpp +++ b/src/zenstore/compactcas.cpp @@ -569,7 +569,7 @@ CasContainerStrategy::MakeIndexSnapshot() } catch (std::exception& Err) { - ZEN_ERROR("snapshot FAILED, reason: '{}'", Err.what()); + ZEN_WARN("snapshot FAILED, reason: '{}'", Err.what()); // Restore any previous snapshot |