Commit ec599ebefe403fe7fec191fc86c1aa234c5b08fe

Authored by Adhidarma Hadiwinoto
1 parent e3ca69a76a
Exists in master

Fix sd-notify wrapper

Showing 1 changed file with 9 additions and 7 deletions Inline Diff

1 /* eslint-disable global-require */ 1 /* eslint-disable global-require */
2 /* eslint-disable import/no-extraneous-dependencies */ 2 /* eslint-disable import/no-extraneous-dependencies */
3 3
4 const MODULE_NAME = 'KOMODO-SDK.SD-NOTIFY'; 4 const MODULE_NAME = 'KOMODO-SDK.SD-NOTIFY';
5 5
6 const logger = require('tektrans-logger'); 6 const logger = require('tektrans-logger');
7 7
8 try { 8 module.exports = () => {
9 const notify = require('sd-notify'); 9 try {
10 notify.ready(); 10 const notify = require('sd-notify');
11 logger.info(`${MODULE_NAME} 701F8400: Systemd ready notification has been sent`); 11 notify.ready();
12 } catch (e) { 12 logger.info(`${MODULE_NAME} 701F8400: Systemd ready notification has been sent`);
13 logger.warn(`${MODULE_NAME} A6C99938: Optional dependency not found: sd-notify`); 13 } catch (e) {
14 } 14 logger.warn(`${MODULE_NAME} A6C99938: Optional dependency not found: sd-notify`);
15 }
16 };
15 17