@bull-board/api
Advanced tools
Comparing version 4.9.0 to 4.10.0
@@ -66,2 +66,3 @@ "use strict"; | ||
allowRetries: queue.allowRetries, | ||
allowCompletedRetries: queue.allowCompletedRetries, | ||
isPaused, | ||
@@ -68,0 +69,0 @@ }; |
@@ -5,6 +5,6 @@ "use strict"; | ||
const queue_1 = require("../providers/queue"); | ||
const statuses_1 = require("../constants/statuses"); | ||
async function retryAll(_req, queue) { | ||
const jobs = await queue.getJobs([statuses_1.STATUSES.failed]); | ||
await Promise.all(jobs.map((job) => job.retry())); | ||
async function retryAll(req, queue) { | ||
const { queueStatus } = req.params; | ||
const jobs = await queue.getJobs([queueStatus]); | ||
await Promise.all(jobs.map((job) => job.retry(queueStatus))); | ||
return { status: 200, body: {} }; | ||
@@ -11,0 +11,0 @@ } |
@@ -6,4 +6,5 @@ "use strict"; | ||
const queue_1 = require("../providers/queue"); | ||
async function retryJob(_req, job) { | ||
await job.retry(); | ||
async function retryJob(req, job) { | ||
const { queueStatus } = req.params; | ||
await job.retry(queueStatus); | ||
return { | ||
@@ -10,0 +11,0 @@ status: 204, |
@@ -5,2 +5,3 @@ import { FormatterField, JobCleanStatus, JobCounts, JobStatus, QueueAdapterOptions, QueueJob } from '../../typings/app'; | ||
readonly allowRetries: boolean; | ||
readonly allowCompletedRetries: boolean; | ||
readonly prefix: string; | ||
@@ -7,0 +8,0 @@ readonly description: string; |
@@ -9,2 +9,3 @@ "use strict"; | ||
this.allowRetries = this.readOnlyMode ? false : options.allowRetries !== false; | ||
this.allowCompletedRetries = this.allowRetries && options.allowCompletedRetries !== false; | ||
this.prefix = options.prefix || ''; | ||
@@ -11,0 +12,0 @@ this.description = options.description || ''; |
@@ -7,2 +7,3 @@ "use strict"; | ||
constructor(queue, options = {}) { | ||
options.allowCompletedRetries = false; // bull doesn't support this | ||
super(options); | ||
@@ -9,0 +10,0 @@ this.queue = queue; |
@@ -32,3 +32,3 @@ "use strict"; | ||
method: 'put', | ||
route: '/api/queues/:queueName/retry', | ||
route: '/api/queues/:queueName/retry/:queueStatus', | ||
handler: retryAll_1.retryAllHandler, | ||
@@ -58,3 +58,3 @@ }, | ||
method: 'put', | ||
route: '/api/queues/:queueName/:jobId/retry', | ||
route: '/api/queues/:queueName/:jobId/retry/:queueStatus', | ||
handler: retryJob_1.retryJobHandler, | ||
@@ -61,0 +61,0 @@ }, |
@@ -5,2 +5,3 @@ import { RedisInfo } from 'redis-info'; | ||
export type JobCleanStatus = 'completed' | 'wait' | 'active' | 'delayed' | 'failed'; | ||
export type JobRetryStatus = 'completed' | 'failed'; | ||
export type Status = keyof typeof STATUSES; | ||
@@ -12,2 +13,3 @@ export type JobStatus = keyof Omit<typeof STATUSES, 'latest'>; | ||
allowRetries: boolean; | ||
allowCompletedRetries: boolean; | ||
prefix: string; | ||
@@ -23,3 +25,3 @@ description: string; | ||
remove(): Promise<void>; | ||
retry(): Promise<void>; | ||
retry(state?: JobRetryStatus): Promise<void>; | ||
toJSON(): QueueJobJson; | ||
@@ -83,2 +85,3 @@ } | ||
allowRetries: boolean; | ||
allowCompletedRetries: boolean; | ||
isPaused: boolean; | ||
@@ -85,0 +88,0 @@ } |
{ | ||
"name": "@bull-board/api", | ||
"version": "4.9.0", | ||
"version": "4.10.0", | ||
"description": "Core server APIs of bull-board", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53447
845