Commit 714f147ac5c4270276eb3ad08691b3afe33732d3

Authored by Adhidarma Hadiwinoto
1 parent b3b28d49f7
Exists in master

MODEM-INFO: logs on idle check

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

... ... @@ -28,8 +28,9 @@ if (!config.disable_idle_check) {
28 28 Math.min(modemInfo.lastWriteTs, modemInfo.lastReadTs),
29 29 );
30 30  
31   - if (deltaMs >= (config.max_last_data_age_ms || DEFAULT_MAX_LAST_DATA_AGE_MS)) {
32   - logger.warn(`Modem idle for ${deltaMs} ms. Modem stucked? Terminating!`);
  31 + const maxLastDataAgeMs = config.max_last_data_age_ms || DEFAULT_MAX_LAST_DATA_AGE_MS;
  32 + if (deltaMs >= maxLastDataAgeMs) {
  33 + logger.warn(`Modem idle for more than ${maxLastDataAgeMs} ms. Stucked modem? Terminating!`, { deltaMs });
33 34 process.exit(1);
34 35 }
35 36 }, config.interval_beetwen_signal_strength_ms || DEFAULT_INTERVAL_BETWEEN_IDLE_CHECK_MS);