Skip to content

Commit

Permalink
Refactor server.mjs to use synchronous fs.mkdir instead of asynchrono…
Browse files Browse the repository at this point in the history
…us fs.mkdir to ensure cache directory creation on server startup.
  • Loading branch information
cryptofyre committed Aug 9, 2024
1 parent bf7b676 commit 2b709c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const port = 3000;
const cacheDir = path.join(__dirname, 'cache');

// Ensure cache directory exists
fs.mkdir(cacheDir, { recursive: true }).catch(err => logger.error(`Error creating cache directory: ${err.message}`));
fsSync.mkdir(cacheDir, { recursive: true }).catch(err => logger.error(`Error creating cache directory: ${err.message}`));

// Configure logging
const logger = winston.createLogger({
Expand Down

0 comments on commit 2b709c7

Please sign in to comment.