fix
This commit is contained in:
@ -887,20 +887,18 @@ void s3_provider::stop() {
|
||||
auto s3_provider::upload_file_impl(const std::string &api_path,
|
||||
const std::string &source_path,
|
||||
stop_type &stop_requested) -> api_error {
|
||||
std::uint64_t file_size{};
|
||||
auto file = utils::file::file{source_path};
|
||||
if (not file.exists()) {
|
||||
return api_error::comm_error;
|
||||
if (file.exists()) {
|
||||
auto opt_size = file.size();
|
||||
if (not opt_size.has_value()) {
|
||||
return api_error::comm_error;
|
||||
}
|
||||
file_size = opt_size.value();
|
||||
}
|
||||
|
||||
auto opt_size = file.size();
|
||||
if (not opt_size.has_value()) {
|
||||
return api_error::comm_error;
|
||||
}
|
||||
|
||||
auto file_size{opt_size.value()};
|
||||
|
||||
const auto cfg = get_config().get_s3_config();
|
||||
const auto is_encrypted = not cfg.encryption_token.empty();
|
||||
auto cfg = get_config().get_s3_config();
|
||||
auto is_encrypted = not cfg.encryption_token.empty();
|
||||
|
||||
std::string key;
|
||||
if (is_encrypted) {
|
||||
@ -910,7 +908,7 @@ auto s3_provider::upload_file_impl(const std::string &api_path,
|
||||
}
|
||||
}
|
||||
|
||||
const auto object_name =
|
||||
auto object_name =
|
||||
utils::path::create_api_path(is_encrypted ? key : api_path);
|
||||
|
||||
curl::requests::http_put_file put_file{};
|
||||
|
Reference in New Issue
Block a user