libstore: asyncify Store::init

Change-Id: I38d59b40ab806996018f0ed17896e3ca9dc303be
This commit is contained in:
eldritch horrors
2025-02-24 15:09:02 +00:00
parent c6f5a6a196
commit 3cdf9fed2f
7 changed files with 33 additions and 15 deletions
+5 -2
View File
@@ -33,8 +33,8 @@ BinaryCacheStore::BinaryCacheStore(const BinaryCacheStoreConfig & config)
narMagic = sink.s;
}
void BinaryCacheStore::init()
{
kj::Promise<Result<void>> BinaryCacheStore::init()
try {
std::string cacheInfoFile = "nix-cache-info";
auto cacheInfo = getFileContents(cacheInfoFile);
@@ -57,6 +57,9 @@ void BinaryCacheStore::init()
}
}
}
co_return result::success();
} catch (...) {
co_return result::current_exception();
}
void BinaryCacheStore::upsertFile(const std::string & path,