| 338 | 1; // linear backoff: 1s, 2s, ... |
| 339 | |
| 340 | int GetEnvInt(const char* name, int default_value) { |
| 341 | const std::optional<std::string> val = GetEnvSafe(name); |
| 342 | if (val.has_value() && !val->empty()) { |
| 343 | try { |
| 344 | return std::stoi(*val); |
| 345 | } catch (const std::exception&) { |
| 346 | LOG(WARNING) << "Invalid value for " << name << ": " << *val |
| 347 | << ". Using default: " << default_value; |
| 348 | } |
| 349 | } |
| 350 | return default_value; |
| 351 | } |
| 352 | |
| 353 | std::optional<std::string> DownloadFile(const std::string& url) { |
| 354 | VLOG(2) << "Downloading file from: " << url; |
no test coverage detected