Skip to content

Commit

Permalink
fix: fix outpout of agenda job status details
Browse files Browse the repository at this point in the history
  • Loading branch information
simllll committed Oct 24, 2020
1 parent be1707e commit 3dc0709
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/JobProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ export class JobProcessor {
},
jobStatus,
queuedJobs: this.jobQueue.length,
runningJobs: !fullDetails ? this.runningJobs.length : this.runningJobs,
lockedJobs: !fullDetails ? this.lockedJobs.length : this.lockedJobs,
jobsToLock: !fullDetails ? this.jobsToLock.length : this.jobsToLock,
runningJobs: !fullDetails
? this.runningJobs.length
: this.runningJobs.map(job => job.toJson()),
lockedJobs: !fullDetails ? this.lockedJobs.length : this.lockedJobs.map(job => job.toJson()),
jobsToLock: !fullDetails ? this.jobsToLock.length : this.jobsToLock.map(job => job.toJson()),
isLockingOnTheFly: this.isLockingOnTheFly
};
}
Expand Down
8 changes: 4 additions & 4 deletions src/types/AgendaStatus.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Job } from '../Job';
import { IJobParameters } from './JobParameters';

export interface IAgendaJobStatus {
[name: string]: { running: number; locked: number };
Expand All @@ -15,8 +15,8 @@ export interface IAgendaStatus {
};
jobStatus?: IAgendaJobStatus;
queuedJobs: number;
runningJobs: number | Job[];
lockedJobs: number | Job[];
jobsToLock: number | Job[];
runningJobs: number | IJobParameters[];
lockedJobs: number | IJobParameters[];
jobsToLock: number | IJobParameters[];
isLockingOnTheFly: boolean;
}

0 comments on commit 3dc0709

Please sign in to comment.