diff --git a/sd-notify.js b/sd-notify.js index 3e032e8..636f3aa 100644 --- a/sd-notify.js +++ b/sd-notify.js @@ -5,10 +5,12 @@ const MODULE_NAME = 'KOMODO-SDK.SD-NOTIFY'; const logger = require('tektrans-logger'); -try { - const notify = require('sd-notify'); - notify.ready(); - logger.info(`${MODULE_NAME} 701F8400: Systemd ready notification has been sent`); -} catch (e) { - logger.warn(`${MODULE_NAME} A6C99938: Optional dependency not found: sd-notify`); -} +module.exports = () => { + try { + const notify = require('sd-notify'); + notify.ready(); + logger.info(`${MODULE_NAME} 701F8400: Systemd ready notification has been sent`); + } catch (e) { + logger.warn(`${MODULE_NAME} A6C99938: Optional dependency not found: sd-notify`); + } +};