Skip to content

Commit

Permalink
[bug] Fix exception caused by missing param 'services.CoAuthoring.plu…
Browse files Browse the repository at this point in the history
…gins.path'
  • Loading branch information
konovalovsergey committed Oct 17, 2024
1 parent 12a0963 commit 9fbd6a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DocService/sources/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,15 @@ fs.watchFile(cfgLicenseFile, updateLicense);
setInterval(updateLicense, 86400000);

try {
fs.watch(config.get('services.CoAuthoring.plugins.path'), updatePlugins);
let staticContent = config.get('services.CoAuthoring.server.static_content');
let pluginsUri = config.get('services.CoAuthoring.plugins.uri');
let pluginsPath = undefined;
if (staticContent[pluginsUri]) {
pluginsPath = staticContent[pluginsUri].path;
}
fs.watch(pluginsPath, updatePlugins);
} catch (e) {
operationContext.global.logger.warn('Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server. https://nodejs.org/docs/latest/api/fs.html#fs_availability');
operationContext.global.logger.warn('Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server. https://nodejs.org/docs/latest/api/fs.html#fs_availability. %s', e.stack);
}

// If you want to use 'development' and 'production',
Expand Down

0 comments on commit 9fbd6a9

Please sign in to comment.