Skip to content

Commit

Permalink
Merge pull request #2 from a28028/a28028-patch-2
Browse files Browse the repository at this point in the history
add await
  • Loading branch information
a28028 committed Oct 2, 2021
2 parents cf8b796 + c0e378b commit 8324f85
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 8324f85

Please sign in to comment.