chore: refactor snapshot expanding logic (#4003)

S3 and file expansion logic had some duplicate code.
this PR refactors it before adding GCS support.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-10-28 10:08:10 +02:00 committed by GitHub
parent db6504564d
commit c2710604de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 101 additions and 91 deletions

View file

@ -1061,7 +1061,7 @@ std::optional<fb2::Future<GenericError>> ServerFamily::Load(string_view load_pat
return future;
}
auto paths_result = snapshot_storage_->LoadPaths(path);
auto paths_result = snapshot_storage_->ExpandSnapshot(path);
if (!paths_result) {
LOG(ERROR) << "Failed to load snapshot: " << paths_result.error().Format();