From fb871dd87323246438521f997a77ac8ae2d22942 Mon Sep 17 00:00:00 2001 From: Rogger Valverde Date: Thu, 5 Dec 2024 22:14:12 -0600 Subject: [PATCH] docs(job-schedulers): add getJobScheduler documentation (#2953) --- docs/gitbook/guide/job-schedulers/README.md | 4 ++++ .../job-schedulers/manage-job-schedulers.md | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/gitbook/guide/job-schedulers/README.md b/docs/gitbook/guide/job-schedulers/README.md index f7bb35af6d..2320ae9e59 100644 --- a/docs/gitbook/guide/job-schedulers/README.md +++ b/docs/gitbook/guide/job-schedulers/README.md @@ -51,3 +51,7 @@ All jobs produced by this scheduler will use the given settings. Note that in th {% hint style="info" %} Since jobs produced by the Job Scheduler will get a special job ID in order to guarantee that jobs will never be created more often than the given repeat settings, you cannot choose a custom job id. However you can use the job's name if you need to discriminate these jobs from other jobs. {% endhint %} + +## Read more: + +- 💡 [Upsert Job Scheduler API Reference](https://api.docs.bullmq.io/classes/v5.Queue.html#upsertJobScheduler) diff --git a/docs/gitbook/guide/job-schedulers/manage-job-schedulers.md b/docs/gitbook/guide/job-schedulers/manage-job-schedulers.md index 4531a20173..164bab8191 100644 --- a/docs/gitbook/guide/job-schedulers/manage-job-schedulers.md +++ b/docs/gitbook/guide/job-schedulers/manage-job-schedulers.md @@ -4,7 +4,7 @@ In BullMQ, managing the lifecycle and inventory of job schedulers is crucial for #### Remove job scheduler -The removeJobScheduler method is designed to delete a specific job scheduler from the queue. This is particularly useful when a scheduled task is no longer needed or if you wish to clean up inactive or obsolete schedulers to optimize resource usage. +The **removeJobScheduler** method is designed to delete a specific job scheduler from the queue. This is particularly useful when a scheduled task is no longer needed or if you wish to clean up inactive or obsolete schedulers to optimize resource usage. ```typescript // Remove a job scheduler with ID 'scheduler-123' @@ -18,7 +18,7 @@ The method will return true if there was a Job Scheduler to remove with the give #### Get Job Schedulers -The getJobSchedulers method retrieves a list of all configured job schedulers within a specified range. This is invaluable for monitoring and managing multiple job schedulers, especially in systems where jobs are dynamically scheduled and require frequent reviews or adjustments. +The **getJobSchedulers** method retrieves a list of all configured job schedulers within a specified range. This is invaluable for monitoring and managing multiple job schedulers, especially in systems where jobs are dynamically scheduled and require frequent reviews or adjustments. ```typescript // Retrieve the first 10 job schedulers in ascending order of their next execution time @@ -27,3 +27,18 @@ console.log('Current job schedulers:', schedulers); ``` This method can be particularly useful for generating reports or dashboards that provide insights into when jobs are scheduled to run, aiding in system monitoring and troubleshooting. + +#### Get Job Scheduler + +The **getJobScheduler** method retrieves a job scheduler by id. This is invaluable for inspecting dedicated configurations. + +```typescript +const scheduler = await queue.getJobScheduler('test); +console.log('Current job scheduler:', scheduler); +``` + +## Read more: + +- 💡 [Remove Job Scheduler API Reference](https://api.docs.bullmq.io/classes/v5.Queue.html#removeJobScheduler) +- 💡 [Get Job Schedulers API Reference](https://api.docs.bullmq.io/classes/v5.Queue.html#getJobSchedulers) +- 💡 [Get Job Scheduler API Reference](https://api.docs.bullmq.io/classes/v5.Queue.html#getJobScheduler)