This commit is contained in:
Antonio Andelic 2024-02-20 14:35:19 +01:00
parent cfda64e1a4
commit 11f3b06099

View File

@ -68,9 +68,13 @@ void moveFileBetweenDisks(DiskPtr disk_from, ChangelogFileDescriptionPtr descrip
/// a different thread could be trying to read from the file
/// we should make sure the source disk contains the file while read is in progress
description->withLock([&]{ description->disk = disk_to; });
disk_from->removeFile(description->path);
description->withLock(
[&]
{
description->disk = disk_to;
description->path = path_to;
});
disk_from->removeFile(description->path);
}
constexpr auto DEFAULT_PREFIX = "changelog";