Nafis Islam
Nafis Islam

Reputation: 1509

Automatic retry on failure, How to set Backoff coefficient

const df = require("durable-functions");

module.exports = df.orchestrator(function*(context) {
    const retryOptions = new df.RetryOptions(5000, 3);

    yield context.df.callActivityWithRetry("FlakyFunction", retryOptions);

    // ...
});

There are several options for customizing the automatic retry policy. They include the following:

Max number of attempts: The maximum number of retry attempts.

First retry interval: The amount of time to wait before the first retry attempt.

Backoff coefficient: The coefficient used to determine rate of increase of backoff. Defaults to 1.

How to set Backoff coefficient?

Upvotes: 0

Views: 940

Answers (1)

Jerry Liu
Jerry Liu

Reputation: 17790

The constructor of RetryOptions takes only two parameters, just set backoffCoefficient after construction, same as other parameters.

const retryOptions = new df.RetryOptions(5000, 3);
retryOptions.backoffCoefficient = 2;

Upvotes: 1

Related Questions