| 94 | } |
| 95 | |
| 96 | _warnOldJobs() { |
| 97 | debug(`LoadEstimator._warnOldJobs(): jobType = ${this.jobType}`); |
| 98 | if (!this.warnOnOldJobs) return; |
| 99 | const nowMS = Date.now(); |
| 100 | _.forEach(this.currentJobs, (info, id) => { |
| 101 | if ((nowMS - info.startMS > config.maxResponseTimeSec * 1000) && !info.warned) { |
| 102 | const details = { |
| 103 | jobType: this.jobType, |
| 104 | id, |
| 105 | ageMS: nowMS - info.startMS, |
| 106 | startMS: info.startMS, |
| 107 | startTimestamp: (new Date(info.startMS)).toISOString(), |
| 108 | }; |
| 109 | logger.error(`load._warnOldJobs(): job exceeded max response time`, details); |
| 110 | info.warned = true; |
| 111 | } |
| 112 | }); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | const estimators = {}; |