1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

USe get for doc exists

This commit is contained in:
Adria Navarro 2024-02-29 13:47:18 +01:00
parent 9f42ea6bbf
commit 10568cccff
2 changed files with 2 additions and 2 deletions

View file

@ -60,7 +60,7 @@ export default class BaseCache {
*/ */
async withCache( async withCache(
key: string, key: string,
ttl: number, ttl: number | null = null,
fetchFn: any, fetchFn: any,
opts = { useTenancy: true } opts = { useTenancy: true }
) { ) {

View file

@ -137,7 +137,7 @@ export class DatabaseImpl implements Database {
async docExists(id: string): Promise<boolean> { async docExists(id: string): Promise<boolean> {
try { try {
await this.get(id) await this.performCall(db => () => db.head(id))
return true return true
} catch { } catch {
return false return false