Replaced a sync file operation by an async one, to avoid blocking the server.

This commit is contained in:
John Livingston 2024-02-14 09:29:33 +01:00
parent afbc78d0e6
commit cd97d91f79
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@
### Minor changes and fixes ### Minor changes and fixes
* Fix ConverseJS build: translations were missing, and only english was available. * Fix ConverseJS build: translations were missing, and only english was available.
* Replaced a sync file operation by an async one, to avoid blocking the server.
## 8.2.1 ## 8.2.1

View File

@ -76,7 +76,7 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
let certsDir: string | undefined = path.resolve(dir, 'certs') let certsDir: string | undefined = path.resolve(dir, 'certs')
let certsDirIsCustom = false let certsDirIsCustom = false
if (settings['prosody-room-allow-s2s'] && (settings['prosody-certificates-dir'] as string ?? '') !== '') { if (settings['prosody-room-allow-s2s'] && (settings['prosody-certificates-dir'] as string ?? '') !== '') {
if (!fs.statSync(settings['prosody-certificates-dir'] as string).isDirectory()) { if (!(await fs.promises.stat(settings['prosody-certificates-dir'] as string)).isDirectory()) {
// We can throw an exception here... // We can throw an exception here...
// Because if the user input a wrong directory, the plugin will not register, // Because if the user input a wrong directory, the plugin will not register,
// and he will never be able to fix the conf // and he will never be able to fix the conf