Commit ec599ebefe403fe7fec191fc86c1aa234c5b08fe
1 parent
e3ca69a76a
Exists in
master
Fix sd-notify wrapper
Showing 1 changed file with 9 additions and 7 deletions Side-by-side Diff
sd-notify.js
... | ... | @@ -5,10 +5,12 @@ const MODULE_NAME = 'KOMODO-SDK.SD-NOTIFY'; |
5 | 5 | |
6 | 6 | const logger = require('tektrans-logger'); |
7 | 7 | |
8 | -try { | |
9 | - const notify = require('sd-notify'); | |
10 | - notify.ready(); | |
11 | - logger.info(`${MODULE_NAME} 701F8400: Systemd ready notification has been sent`); | |
12 | -} catch (e) { | |
13 | - logger.warn(`${MODULE_NAME} A6C99938: Optional dependency not found: sd-notify`); | |
14 | -} | |
8 | +module.exports = () => { | |
9 | + try { | |
10 | + const notify = require('sd-notify'); | |
11 | + notify.ready(); | |
12 | + logger.info(`${MODULE_NAME} 701F8400: Systemd ready notification has been sent`); | |
13 | + } catch (e) { | |
14 | + logger.warn(`${MODULE_NAME} A6C99938: Optional dependency not found: sd-notify`); | |
15 | + } | |
16 | +}; |