Fix BinaryCacheStore::registerDrvOutput

Was crashing because coercing a json document into a string is only
valid if the json is a string, otherwise we need to call `.dump()`
This commit is contained in:
regnat 2020-12-15 09:34:45 +01:00
parent e3ddffb27e
commit 962b82ef25

View file

@ -460,7 +460,7 @@ std::optional<const Realisation> BinaryCacheStore::queryRealisation(const DrvOut
void BinaryCacheStore::registerDrvOutput(const Realisation& info) {
auto filePath = realisationsPrefix + "/" + info.id.to_string() + ".doi";
upsertFile(filePath, info.toJSON(), "application/json");
upsertFile(filePath, info.toJSON().dump(), "application/json");
}
ref<FSAccessor> BinaryCacheStore::getFSAccessor()