From 18495c44aab7be1d7acb99609cec48dcfeb6393a Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Mon, 13 Mar 2023 21:22:13 +0900 Subject: [PATCH] Added cache clearing on upload error (#2127) --- src/fdcache_entity.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fdcache_entity.cpp b/src/fdcache_entity.cpp index 0d8dbdd..e060a08 100644 --- a/src/fdcache_entity.cpp +++ b/src/fdcache_entity.cpp @@ -1446,6 +1446,14 @@ int FdEntity::RowFlush(int fd, const char* tpath, AutoLock::Type type, bool forc result = RowFlushMultipart(pseudo_obj, tpath); } + // [NOTE] + // if something went wrong, so if you are using a cache file, + // the cache file may not be correct. So delete cache files. + // + if(0 != result && !cachepath.empty()){ + FdManager::DeleteCacheFile(tpath); + } + return result; }