Skip to content

Commit

Permalink
build(types): build types only once (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf authored Feb 3, 2023
1 parent f31ad20 commit a104eb1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 1 addition & 3 deletions docs/gitbook/guide/jobs/delayed.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Delayed

The jobs added to a queue will normally be processed as quick as some worker is available for dispatching them. However, it is also possible to add a delay parameter so that jobs will wait at least that amount of time before being processed. Note that this does not guarantee that the job will be processed at that exact delayed time, it depends on how busy the queue is when the time has passed and how many other delayed jobs are scheduled at that exact time.

{% hint style="info" %}
Expand All @@ -24,4 +22,4 @@ await myQueue.add('house', { color: 'white' }, { delay: 5000 });

## Read more:

* 💡 [Queue Scheduler API Reference](https://github.com/taskforcesh/bullmq/blob/v1.91.1/docs/gitbook/api/bullmq.queuescheduler.md)
- 💡 [Queue Scheduler API Reference](https://github.com/taskforcesh/bullmq/blob/v1.91.1/docs/gitbook/api/bullmq.queuescheduler.md)
4 changes: 4 additions & 0 deletions docs/gitbook/guide/retrying-failing-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ When a processor throws an exception, the worker will catch it and move the job

BullMQ supports retries of failed jobs using backoff functions. It is possible to use the built in backoff functions or provide custom ones.

{% hint style="danger" %}
In general, you should never throw anything that is not an Error object. There is an eslint rule for that if you want to enforce it: https://eslint.org/docs/latest/rules/no-throw-literal
{% endhint %}

For BullMQ to reschedule failed jobs, make sure you create a `QueueScheduler` for your queue.

{% hint style="danger" %}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Queue for messages and jobs based on Redis",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"types": "./dist/types/index.d.ts",
"source": "./src/index.ts",
"author": "Taskforce.sh Inc.",
"license": "MIT",
Expand Down
4 changes: 3 additions & 1 deletion tsconfig-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"outDir": "dist/cjs"
"outDir": "dist/cjs",
"declaration": false,
"declarationDir": null
}
}
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"types": ["node"],
"target": "ES2017",
"module": "ES2020",
"incremental": true,
"declarationDir": "dist/types",
"declaration": true,
"outDir": "dist/esm",
"sourceMap": true,
Expand Down

0 comments on commit a104eb1

Please sign in to comment.