MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / _warnOldJobs

Method _warnOldJobs

lib/load.js:96–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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
116const estimators = {};

Callers 1

_reportLoadMethod · 0.95

Calls 1

debugFunction · 0.85

Tested by

no test coverage detected