diff options
Diffstat (limited to 'src/libstore/binary-cache-store.cc')
-rw-r--r-- | src/libstore/binary-cache-store.cc | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 88b8db972..85ca36667 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -442,21 +442,16 @@ StorePath BinaryCacheStore::addTextToStore( })->path; } -void BinaryCacheStore::queryRealisationUncached(const DrvOutput & id, - Callback<std::shared_ptr<const Realisation>> callback) noexcept +std::shared_ptr<const Realisation> BinaryCacheStore::queryRealisationUncached(const DrvOutput & id) { auto outputInfoFilePath = realisationsPrefix + "/" + id.to_string() + ".doi"; - try { - auto data = getFile(outputInfoFilePath); - if (!data) return callback({}); - - auto realisation = Realisation::fromJSON( - nlohmann::json::parse(*data), outputInfoFilePath); - return callback(std::make_shared<const Realisation>(realisation)); - } catch (...) { - callback.rethrow(); - } + auto data = getFile(outputInfoFilePath); + if (!data) return {}; + + auto realisation = Realisation::fromJSON( + nlohmann::json::parse(*data), outputInfoFilePath); + return std::make_shared<const Realisation>(realisation); } void BinaryCacheStore::registerDrvOutput(const Realisation& info) { |