USe get for doc exists
This commit is contained in:
parent
9f42ea6bbf
commit
10568cccff
|
@ -60,7 +60,7 @@ export default class BaseCache {
|
|||
*/
|
||||
async withCache(
|
||||
key: string,
|
||||
ttl: number,
|
||||
ttl: number | null = null,
|
||||
fetchFn: any,
|
||||
opts = { useTenancy: true }
|
||||
) {
|
||||
|
|
|
@ -137,7 +137,7 @@ export class DatabaseImpl implements Database {
|
|||
|
||||
async docExists(id: string): Promise<boolean> {
|
||||
try {
|
||||
await this.get(id)
|
||||
await this.performCall(db => () => db.head(id))
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue