Fix/fs-rmdir-deprecation (#3296)

This commit is contained in:
Hao He 2025-03-13 20:45:45 +08:00 committed by GitHub
parent 65d7e24aef
commit 96cd207b1b

View File

@ -271,12 +271,12 @@ class FileStorage {
} }
public clear = async (): Promise<void> => { public clear = async (): Promise<void> => {
await fs.promises.rmdir(this.storageDir, { recursive: true }) await fs.promises.rm(this.storageDir, { recursive: true })
await this.initStorageDir() await this.initStorageDir()
} }
public clearTemp = async (): Promise<void> => { public clearTemp = async (): Promise<void> => {
await fs.promises.rmdir(this.tempDir, { recursive: true }) await fs.promises.rm(this.tempDir, { recursive: true })
await fs.promises.mkdir(this.tempDir, { recursive: true }) await fs.promises.mkdir(this.tempDir, { recursive: true })
} }