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 {
return std::visit(makeVisitor {
[](Mod* mod) {
// todo: cache
return server::getMod(mod->getID());
return server::ServerResultCache<&server::getMod>::shared().get(mod->getID());
},
[](server::ServerModMetadata const& metadata) {
return server::ServerPromise<server::ServerModMetadata>([&metadata](auto resolve, auto) {