@@ -169,33 +169,33 @@ myQueue.add({foo: 'bar'}, {
169
169
170
170
You may specify options for your strategy:
171
171
``` js
172
- var Queue = require (' bull' );
172
+ const Queue = require (' bull' );
173
173
174
- var myQueue = new Queue (" Server B" , {
174
+ const myQueue = new Queue (' Server B' , {
175
175
settings: {
176
176
backoffStrategies: {
177
177
// truncated binary exponential backoff
178
178
binaryExponential : function (attemptsMade , err , options ) {
179
179
// Options can be undefined, you need to handle it by yourself
180
180
if (! options) {
181
- options = {}
181
+ options = {}
182
182
}
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 });
186
186
return Math .round (Math .random () * (Math .pow (2 , Math .max (attemptsMade, truncate)) - 1 ) * delay)
187
187
}
188
188
}
189
189
}
190
190
});
191
191
192
- myQueue .add ({foo: ' bar' }, {
192
+ myQueue .add ({ foo: ' bar' }, {
193
193
attempts: 10 ,
194
194
backoff: {
195
195
type: ' binaryExponential' ,
196
196
options: {
197
- delay: 500 ,
198
- truncate: 5
197
+ delay: 500 ,
198
+ truncate: 5
199
199
}
200
200
}
201
201
});
0 commit comments