ChargingStationConfiguration = 'charging station configuration',
ChargingStationTemplate = 'charging station template',
PerformanceRecords = 'performance records',
+ JsonSchema = 'json schema',
}
private static getConfigurationFileWatcher(): fs.FSWatcher | undefined {
try {
return fs.watch(Configuration.configurationFile, (event, filename): void => {
- if (filename && event === 'change') {
+ if (filename.trim().length !== 0 && event === 'change') {
// Nullify to force configuration file reading
Configuration.configuration = null;
if (!Configuration.isUndefined(Configuration.configurationChangeCallback)) {
file: string,
refreshedVariable?: T,
listener: fs.WatchListener<string> = (event, filename) => {
- if (filename && event === 'change') {
+ if (!Utils.isEmptyString(filename) && event === 'change') {
try {
logger.debug(`${logPrefix} ${fileType} file ${file} have changed, reload`);
refreshedVariable && (refreshedVariable = JSON.parse(fs.readFileSync(file, 'utf8')) as T);
}
}
): fs.FSWatcher | undefined {
- if (file) {
+ if (!Utils.isEmptyString(file)) {
try {
return fs.watch(file, listener);
} catch (error) {