diff --git a/src/cdn/util/FileStorage.ts b/src/cdn/util/FileStorage.ts index 9ebe9f7..6f01b3c 100644 --- a/src/cdn/util/FileStorage.ts +++ b/src/cdn/util/FileStorage.ts @@ -18,6 +18,7 @@ import { Storage } from "./Storage"; import fs from "fs"; +import fsp from "fs/promises"; import { join, dirname } from "path"; import { Readable } from "stream"; import ExifTransformer from "exif-be-gone"; @@ -37,12 +38,12 @@ async get(path: string): Promise { path = getPath(path); try { - return fs.readFileSync(path); + return await fsp.readFile(path); } catch (error) { try { const files = fs.readdirSync(path); if (!files.length) return null; - return fs.readFileSync(join(path, files[0])); + return await fsp.readFile(join(path, files[0])); } catch (error) { return null; }