USe get for doc exists
This commit is contained in:
parent
ff7c8d3b95
commit
7d50a70d03
|
@ -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 }
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -136,7 +136,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
|
||||||
|
|
Loading…
Reference in New Issue