0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Updated logging

This commit is contained in:
Steve Larson 2024-09-10 09:58:26 -05:00
parent ced8c1af9e
commit 0f37ea5102

View file

@ -32,14 +32,8 @@ class JobManagerBackground {
* @returns {Promise<void>}
*/
async init() {
console.log(`[JobManager] Initializing`);
this.reportStats();
if (this.#testMode) {
// this.testDataContinuousFill();
this.startQueueFiller();
}
console.log(`[JobManager] Initializing job queue`);
this.startQueueFiller();
}
/**
@ -87,12 +81,12 @@ class JobManagerBackground {
}
isPolling = true;
console.log(`[JobManager] Polling for jobs, current interval: ${Math.floor(currentPollInterval / 1000)}s`);
console.log(`[JobManager] Polling for jobs; current interval: ${Math.floor(currentPollInterval / 1000)}s`);
try {
const stats = await this.getStats();
if (stats.pendingTasks <= 500) {
const entriesToAdd = Math.min(500, 501 - stats.pendingTasks);
console.log(`[JobManager] Adding ${entriesToAdd} queue entries. Current pending tasks: ${stats.pendingTasks}`);
console.log(`[JobManager] Adding up to ${entriesToAdd} queue entries. Current pending tasks: ${stats.pendingTasks}. Current worker count: ${stats.totalWorkers}`);
const jobs = await this.jobsRepository.getQueuedJobs(entriesToAdd);
if (jobs.length > 0) {