Prefer using cache file when opening files if it exists
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
parent
b47088bb53
commit
5357e1715c
@ -23,6 +23,7 @@
|
||||
* Fixed setting `HostConfig.Path` via `set_value_by_name`
|
||||
* Fixed setting `HostConfig.Protocol` via `set_value_by_name`
|
||||
* Integrated `renterd` version 2.x
|
||||
* Prefer using cache file when opening files if it exists
|
||||
* Refactored `app_config` unit tests
|
||||
* Refactored polling to be more accurate on scheduling tasks
|
||||
|
||||
|
@ -466,6 +466,13 @@ auto file_manager::open(const std::string &api_path, bool directory,
|
||||
return download_type::default_;
|
||||
}
|
||||
|
||||
if (utils::file::file{fsi.source_path}.exists()) {
|
||||
auto size = utils::file::file{fsi.source_path}.size();
|
||||
if (size.has_value() && *size == fsi.size) {
|
||||
return download_type::default_;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == download_type::direct) {
|
||||
return type;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user