diff options
| author | Dan Engelbrecht <[email protected]> | 2022-03-24 22:41:46 +0100 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-03-31 11:29:27 +0200 |
| commit | 52bf08afc4b9da9ccdd73089c8ebfc7bda859bd3 (patch) | |
| tree | 87fdb172c98fd05b5c64398cce6b1c6be6db257e /zenserver/projectstore.cpp | |
| parent | clean up paths (diff) | |
| download | zen-52bf08afc4b9da9ccdd73089c8ebfc7bda859bd3.tar.xz zen-52bf08afc4b9da9ccdd73089c8ebfc7bda859bd3.zip | |
Migration now works in larger disk IO chunks
BasicFile and CasLogFile now has new explicit modes instead of create true/false
Diffstat (limited to 'zenserver/projectstore.cpp')
| -rw-r--r-- | zenserver/projectstore.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/zenserver/projectstore.cpp b/zenserver/projectstore.cpp index 58b806989..f916b2250 100644 --- a/zenserver/projectstore.cpp +++ b/zenserver/projectstore.cpp @@ -114,10 +114,10 @@ struct ProjectStore::OplogStorage : public RefCounted CreateDirectories(m_OplogStoragePath); } - m_Oplog.Open(m_OplogStoragePath / "ops.zlog", IsCreate); + m_Oplog.Open(m_OplogStoragePath / "ops.zlog", IsCreate ? CasLogFile::EMode::kTruncate : CasLogFile::EMode::kWrite); m_Oplog.Initialize(); - m_OpBlobs.Open(m_OplogStoragePath / "ops.zops", IsCreate); + m_OpBlobs.Open(m_OplogStoragePath / "ops.zops", IsCreate ? BasicFile::EMode::kTruncate : BasicFile::EMode::kWrite); ZEN_ASSERT(IsPow2(m_OpsAlign)); ZEN_ASSERT(!(m_NextOpsOffset & (m_OpsAlign - 1))); @@ -653,7 +653,7 @@ ProjectStore::Project::Read() ZEN_INFO("reading config for project '{}' from {}", Identifier, ProjectStateFilePath); BasicFile Blob; - Blob.Open(ProjectStateFilePath, false); + Blob.Open(ProjectStateFilePath, BasicFile::EMode::kRead); IoBuffer Obj = Blob.ReadAll(); CbValidateError ValidationError = ValidateCompactBinary(MemoryView(Obj.Data(), Obj.Size()), CbValidateMode::All); @@ -693,7 +693,7 @@ ProjectStore::Project::Write() ZEN_INFO("persisting config for project '{}' to {}", Identifier, ProjectStateFilePath); BasicFile Blob; - Blob.Open(ProjectStateFilePath, true); + Blob.Open(ProjectStateFilePath, BasicFile::EMode::kTruncate); Blob.Write(Mem.Data(), Mem.Size(), 0); Blob.Flush(); } |