Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devkit: import retry from ahrefskit #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

glionnet
Copy link

@glionnet glionnet commented Apr 8, 2022

This code brings various implementation of exponential backoff used at ahrefs, I am looking to open-source them in order to be able to open-source some other component relying on it.

let log = Log.from "retry"

(** Clamped random exponential backoff for retry *)
let exp_backoff_pause ?max_delay attempt =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max_delay should be required here? @jorisgio

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems to always be used with this parameter specified in our codebase, I'm making it required.

loop ()

let wait_pause' ?ignore_should_exit = wait_pause'' ?ignore_should_exit id
let wait_pause ?ignore_should_exit master = wait_pause'' ?ignore_should_exit master#poll
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't belong to shared code..

in
loop f 1

let exp_backoff_blocking ~master ~exn ~name ?max_retries ~max_delay attempt =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use this opportunity to introduce "retry policy record" to group all(?) these arguments together

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants