Skip to content

Commit cda82b5

Browse files
fix: retrieve via cache key
1 parent 2980baa commit cda82b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/modules/firebase/server.firebase.rtdb.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function attemptToCacheInLru(key: string, lru?: LruCache) {
4444
}
4545

4646
function attemptToGetCachedValue<T>(key: string, lru?: LruCache) {
47-
return lru && lru.get<T>(key)
47+
return lru && lru.get<T>(sha256(key))
4848
}
4949

5050
// tslint:disable:no-this
@@ -66,7 +66,7 @@ export class ServerUniversalRtDbService implements IUniversalRtdbService {
6666
const url = constructFbUrl(this.afdb, path)
6767
const params = getParams({ auth: this.authToken })
6868
const cacheKey = getFullUrl(url, params)
69-
const cachedValue = attemptToGetCachedValue<T>(cacheKey)
69+
const cachedValue = attemptToGetCachedValue<T>(cacheKey, this.lru)
7070

7171
const baseObs = this.authToken
7272
? this.http.get<T>(url, { params })

0 commit comments

Comments
 (0)