This commit is contained in:
kssenii 2023-06-06 15:15:51 +02:00
parent 24e015b961
commit a96c1ea86f
2 changed files with 2 additions and 2 deletions

View File

@ -381,7 +381,7 @@ void FileSegment::write(const char * from, size_t size, size_t offset)
const auto file_size = fs::file_size(file_segment_path);
chassert(downloaded_size <= file_size);
chassert(reserved_size >= file_size);
chassert(file_size <= range().right + 1);
chassert(file_size <= range().size());
if (downloaded_size != file_size)
downloaded_size = file_size;
}

View File

@ -370,8 +370,8 @@ KeyMetadata::iterator LockedKey::removeFileSegment(size_t offset, const FileSegm
bool exists = fs::exists(path);
if (exists)
{
LOG_TEST(log, "Removed file segment at path: {}", path);
fs::remove(path);
LOG_TEST(log, "Removed file segment at path: {}", path);
}
else if (file_segment->downloaded_size)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Expected path {} to exist");