| 494 | hashmap<CommandInfo::URI, Option<shared_ptr<Cache::Entry>>> result; |
| 495 | |
| 496 | foreachpair (const CommandInfo::URI& uri, |
| 497 | const Option<Future<shared_ptr<Cache::Entry>>>& entry, |
| 498 | entries) { |
| 499 | if (entry.isSome()) { |
| 500 | if (entry->isReady()) { |
| 501 | result[uri] = entry->get(); |
| 502 | } else { |
| 503 | LOG(WARNING) |
| 504 | << "Reverting to fetching directly into the sandbox for '" |
| 505 | << uri.value() |
| 506 | << "', due to failure to fetch through the cache, " |
| 507 | << "with error: " << entry->failure(); |
| 508 | |
| 509 | result[uri] = None(); |
| 510 | } |
| 511 | } else { |
| 512 | // No entry means bypassing the cache. |
| 513 | result[uri] = None(); |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | // NOTE: While we could inline '__fetch' we've explicitly kept |
| 518 | // it as a separate function to minimize complexity. Like with |
nothing calls this directly
no test coverage detected