more async io

This commit is contained in:
Rory&
2025-12-19 20:34:43 +01:00
parent 381095f817
commit 2d99567b5e
2 changed files with 3 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ router.get(
},
},
}),
async (req: Request, res: Response) => {
(req: Request, res: Response) => {
const config = ConnectionConfig.get();
Object.keys(config).forEach((key) => {

View File

@@ -46,12 +46,12 @@ const router = Router({ mergeParams: true });
async function getFile(path: string) {
try {
return fs.readFile(path);
return await fs.readFile(path);
} catch (error) {
try {
const files = await fs.readdir(path);
if (!files.length) return null;
return fs.readFile(join(path, files[0]));
return await fs.readFile(join(path, files[0]));
} catch (error) {
return null;
}