Commit 08c7f4069cdce828fca342efbc542b6d667c6b7c

Authored by Adhidarma Hadiwinoto
1 parent 770e57599f
Exists in master

Log on exception at fileCountOnDir

Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff

lib/smstools-util.js
1 1 const fs = require('fs');
2 2 const childProcess = require('child_process');
3 3 const config = require('komodo-sdk/config');
  4 +const logger = require('komodo-sdk/logger');
4 5  
5 6 exports.restart = () => new Promise((resolve) => {
6 7 const fileToExec = config.restart_smstools_wrapper || '/var/lib/smstools/centers/smstools/bin/restart-smstools';
... ... @@ -18,6 +19,9 @@ exports.fileCountOnDir = async (dirname) => {
18 19 const files = fs.promises.readdir(dirname);
19 20 return files.filter((item) => item.search(/LOCK$/) >= 0).length;
20 21 } catch (e) {
  22 + logger.warn('SMSTOOLS-UTIL: Exception on fileCountOnDir', {
  23 + e: e.message || e.toString(),
  24 + });
21 25 return null;
22 26 }
23 27 };