aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--federationapi/storage/cache/keydb.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/federationapi/storage/cache/keydb.go b/federationapi/storage/cache/keydb.go
index b53695ca..d63c889d 100644
--- a/federationapi/storage/cache/keydb.go
+++ b/federationapi/storage/cache/keydb.go
@@ -46,6 +46,10 @@ func (d *KeyDatabase) FetchKeys(
delete(requests, req)
}
}
+ // Don't bother hitting the DB if we got everything from cache.
+ if len(requests) == 0 {
+ return results, nil
+ }
fromDB, err := d.inner.FetchKeys(ctx, requests)
if err != nil {
return results, err