question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possibility to set Initial delay

See original GitHub issue

Is there a way to set up initial delay before first attempt? If no would be nice to have such possibility.

My current retry config looks like this: ``` RetryConfig config = RetryConfig.custom() .maxAttempts(exponentialRetryConfiguration.getMaxAmountOfAttempts()) .intervalFunction(intervalFn) .build();

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
hexmindcommented, Sep 21, 2020

Maybe custom, provided implementation of intervalFunction (with specific first interval as a delay) would help.

0reactions
RobWincommented, Sep 30, 2020

You are right. The waitDuration property is ignored, if a custom interval function is used. The config property ``waitDurationjust a shortcut for a constant interval function like(numOfAttempts) -> waitDuration.toMillis()`

The initial wait duration is calculated at runtime as follows:

long interval = intervalFunction.apply(numOfAttempts.get());

In your case the initial delay before the first retry attempt is config.getInitialExponentialDelay().

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set initial delay to a Periodic Work Manager in Android
PeriodicWorkRequests now support initial delays. You can use the setInitialDelay method on PeriodicWorkRequest. Builder to set an initial delay.
Read more >
Set initial delay for periodic work - Issue Tracker - Google
I find that the immediate work is performed at 0 mins (triggered explicitly, not by WorkManager, so that's as expected), then at 15...
Read more >
Set initial delay to a Periodic Work Manager in Android-kotlin
PeriodicWorkRequests now support initial delays. You can use the setInitialDelay method on PeriodicWorkRequest. Builder to set an initial delay.
Read more >
Define work requests | Android Developers
Backoff delay specifies the minimum amount of time to wait before retrying your work after the first attempt. This value can be no...
Read more >
Delay | AnyLogic Help
If the option is selected (true), the capacity of the Delay is maximum possible (limited by Integer.MAX_VALUE). Syntax: boolean maximumCapacity. Default value: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found