Added cache clearing on upload error (#2127)

This commit is contained in:
Takeshi Nakatani 2023-03-13 21:22:13 +09:00 committed by GitHub
parent 4f22354aae
commit 18495c44aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}