[core] Fix Singleton Issues

This commit is contained in:
devlikepro committed 2024-10-28 15:57:39 +07:00
1 parent be1783c029
commit 6226e65e97
1 file changed
+10 -1
+10 -1
View File
@@ -74,7 +74,16 @@ export class LocalAuth implements AuthStrategy {
const files = await fs.promises.readdir(dir);
for (const file of files) {
if (file.startsWith('Singleton')) {
await this.removePathSilently(path.join(dir, file));
const filePath = path.join(dir, file);
try {
await fs.promises.rm(filePath, {
maxRetries: this.rmMaxRetries,
recursive: true,
force: true,
});
} catch (err) {
this.logger.error(err, `Error deleting: ${filePath}`);
}
}
}
}