Skip to content

Commit

Permalink
ensure during persistence file is overwritten
Browse files Browse the repository at this point in the history
Summary: current flags cause new content to be appended to the existing file. adjust the flag so we overwrite existing content.

Reviewed By: jiayuebao

Differential Revision: D39770457

fbshipit-source-id: 1acfe259141d307cf832cb0a7c4f6c1775b1c017
  • Loading branch information
moakbari authored and facebook-github-bot committed Sep 23, 2022
1 parent 78a2296 commit 33d9b3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cachelib/experimental/objcache/Persistence.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class ObjectCachePersistor {
queuBatchSize_(queueBatchSize) {
for (size_t i = 0; i < numOfThreads; i++) {
auto file = folly::File(fileName + "_" + folly::to<std::string>(i),
O_WRONLY | O_CREAT);
O_WRONLY | O_CREAT | O_TRUNC);
if (file) {
auto rw = navy::createFileRecordWriter(std::move(file));
persistors_.emplace_back(std::make_shared<PersistorWorkerObj>(
Expand Down

0 comments on commit 33d9b3d

Please sign in to comment.