mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Updated logging
This commit is contained in:
parent
ced8c1af9e
commit
0f37ea5102
1 changed files with 4 additions and 10 deletions
|
@ -32,14 +32,8 @@ class JobManagerBackground {
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async init() {
|
async init() {
|
||||||
console.log(`[JobManager] Initializing`);
|
console.log(`[JobManager] Initializing job queue`);
|
||||||
|
this.startQueueFiller();
|
||||||
this.reportStats();
|
|
||||||
|
|
||||||
if (this.#testMode) {
|
|
||||||
// this.testDataContinuousFill();
|
|
||||||
this.startQueueFiller();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,12 +81,12 @@ class JobManagerBackground {
|
||||||
}
|
}
|
||||||
|
|
||||||
isPolling = true;
|
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 {
|
try {
|
||||||
const stats = await this.getStats();
|
const stats = await this.getStats();
|
||||||
if (stats.pendingTasks <= 500) {
|
if (stats.pendingTasks <= 500) {
|
||||||
const entriesToAdd = Math.min(500, 501 - stats.pendingTasks);
|
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);
|
const jobs = await this.jobsRepository.getQueuedJobs(entriesToAdd);
|
||||||
|
|
||||||
if (jobs.length > 0) {
|
if (jobs.length > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue