Skip to content

Commit

Permalink
add await
Browse files Browse the repository at this point in the history
This condition will always return true since this 'Promise<Boolean>' is always defined
  • Loading branch information
a28028 committed Oct 2, 2021
1 parent cf8b796 commit c0e378b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Engines/FileCache.ts
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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<Boolean> {
try {
if (this.isCacheExist(key)) {
if (await this.isCacheExist(key)) {
const path = this.path()
fs.unlinkSync(path + '/' + this.hashKey(key) + '.cache')
return true
Expand Down

0 comments on commit c0e378b

Please sign in to comment.