From c0e378b36fa9c918e162607b9769bd52d663fc82 Mon Sep 17 00:00:00 2001 From: hossein raja <40133548+a28028@users.noreply.github.com> Date: Sat, 2 Oct 2021 13:22:12 +0330 Subject: [PATCH] add await This condition will always return true since this 'Promise' is always defined --- src/Engines/FileCache.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Engines/FileCache.ts b/src/Engines/FileCache.ts index f190d04..0b4d3bc 100644 --- a/src/Engines/FileCache.ts +++ b/src/Engines/FileCache.ts @@ -1,5 +1,5 @@ import EngineInterface from '../Contracts/EngineInterface' -const fs = require('fs') +import fs from 'fs' const sha256 = require('crypto-js/sha256') // const FileCache = use("FileCache"); @@ -117,9 +117,9 @@ class FileCache implements EngineInterface { return fs.existsSync(path + '/' + this.hashKey(key) + '.cache') } - private deleteFIle(key: string): Boolean { + private async deleteFIle(key: string): Promise { try { - if (this.isCacheExist(key)) { + if (await this.isCacheExist(key)) { const path = this.path() fs.unlinkSync(path + '/' + this.hashKey(key) + '.cache') return true