cache mod server info requests

This commit is contained in:
HJfod 2024-03-23 19:49:26 +02:00
parent fa62b8813e
commit ec5dafbc8f

View file

@ -48,8 +48,7 @@ server::ServerModMetadata const* ModSource::asServer() const {
server::ServerPromise<server::ServerModMetadata> ModSource::fetchServerInfo() const { server::ServerPromise<server::ServerModMetadata> ModSource::fetchServerInfo() const {
return std::visit(makeVisitor { return std::visit(makeVisitor {
[](Mod* mod) { [](Mod* mod) {
// todo: cache return server::ServerResultCache<&server::getMod>::shared().get(mod->getID());
return server::getMod(mod->getID());
}, },
[](server::ServerModMetadata const& metadata) { [](server::ServerModMetadata const& metadata) {
return server::ServerPromise<server::ServerModMetadata>([&metadata](auto resolve, auto) { return server::ServerPromise<server::ServerModMetadata>([&metadata](auto resolve, auto) {