Skip to content

Commit 236f812

Browse files
DavideViolantemanast
authored andcommitted
docs: prefer const in PATTERNS.md
1 parent 562c9db commit 236f812

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

PATTERNS.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -169,33 +169,33 @@ myQueue.add({foo: 'bar'}, {
169169

170170
You may specify options for your strategy:
171171
```js
172-
var Queue = require('bull');
172+
const Queue = require('bull');
173173

174-
var myQueue = new Queue("Server B", {
174+
const myQueue = new Queue('Server B', {
175175
settings: {
176176
backoffStrategies: {
177177
// truncated binary exponential backoff
178178
binaryExponential: function (attemptsMade, err, options) {
179179
// Options can be undefined, you need to handle it by yourself
180180
if (!options) {
181-
options = {}
181+
options = {}
182182
}
183-
var delay = options.delay || 1000;
184-
var truncate = options.truncate || 1000;
185-
console.error({attemptsMade, err, options});
183+
const delay = options.delay || 1000;
184+
const truncate = options.truncate || 1000;
185+
console.error({ attemptsMade, err, options });
186186
return Math.round(Math.random() * (Math.pow(2, Math.max(attemptsMade, truncate)) - 1) * delay)
187187
}
188188
}
189189
}
190190
});
191191

192-
myQueue.add({foo: 'bar'}, {
192+
myQueue.add({ foo: 'bar' }, {
193193
attempts: 10,
194194
backoff: {
195195
type: 'binaryExponential',
196196
options: {
197-
delay: 500,
198-
truncate: 5
197+
delay: 500,
198+
truncate: 5
199199
}
200200
}
201201
});

0 commit comments

Comments
 (0)