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

Hardcoded RPC retry schedule should be dynamic #208

Open
bauti-defi opened this issue Oct 24, 2023 · 3 comments
Open

Hardcoded RPC retry schedule should be dynamic #208

bauti-defi opened this issue Oct 24, 2023 · 3 comments

Comments

@bauti-defi
Copy link

Hello, as of right now the rpc retry schedule is hardcoded.

constructor(options: RpcClientOptions) {
        this.url = trimCredentials(options.url)
        this.con = this.createConnection(options.url)
        this.maxBatchCallSize = options.maxBatchCallSize ?? Number.MAX_SAFE_INTEGER
        this.capacity = options.capacity ?? 10
        this.requestTimeout = options.requestTimeout ?? 0
        this.retryAttempts = options.retryAttempts ?? 0
        this.retrySchedule = options.retrySchedule ?? [10, 100, 500, 2000, 10000, 20000] // HERE!

     // .....
    }

I would like to incorporate this option into the RpcChain config so it can be dynamically set. I am willing to fork the repo, implement the change and open up a PR to be merged in. Would the team be interested in this?

@eldargab
Copy link
Collaborator

Not really...

@eldargab eldargab reopened this Oct 26, 2023
@eldargab
Copy link
Collaborator

Alright, allowing retrySchedule(attempt: number, reason: Error): number will not harm, I guess...

@bauti-defi
Copy link
Author

I will implement this soon and submit PR. Please keep this open, thank you @eldargab

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

No branches or pull requests

2 participants