tim-kos/node-retry

Execute first attempt immediately

satazor opened this issue · 2 comments

According to the formula, a minTimeout of 1000ms will always execute the first attempt after 1000ms (assuming randomize: false).

Is there a way to make retry attempt immediately (perhaps on process.nextTick)?
Note that putting the minTimeout value to 1ms will do it but then we don't get any benefit of the backoff.

I'm doing this ugly hack for now:

    operation = retry.operation(options);
    operation._timeouts[0] = 0;  // Force first immediately

nvm ignore me.