To add a delay to your job, simply include a delay parameter in your request options. The delay value should be in milliseconds.

Here's an example of a job request with a delay of 1 second (1000 milliseconds):

import axios from 'axios';'', {
  "topic": "create-todo",
  "target": "",
  "method": "POST",
  "data": {
    "title": "foo",
    "body": "bar",
    "userId": 1
  "options": {
    "delay": 1000
}, {
  headers: {
    'X-NextCron-Token': "<insert_your_api_token>"

In this example, the job will be delayed by 1 second before being executed. This can be useful if you want to delay a job to allow time for other actions to complete first.

Remember that the delay value should be in milliseconds, so for a delay of 5 seconds, the value should be 5000.

Last updated