Skip to content

Reduce the timeout from 5mins to something like 1min #441

@peterpeterparker

Description

@peterpeterparker

Motivation

Good idea share by @ilbertt

Notes

you can create your strategy with:
chain(conditionalDelay(once(), 1000), backoff(1000, 1.2), timeout(60_000));
Which basically is the same as defaultStrategy but with lower timeout.
You can pass the strategy to the single update call you are doing using the withOptions method. this is a test that does it that you can use as an example: https://github.com/dfinity/icp-js-core/blob/5e11ae098e9048ecdd243ddc080ca1cb908117b8/e2e/node/basic/counter.test.ts#L103
So in your case:
junoSatelliteActor.upload(...).withOptions({
strategy: () => chain(conditionalDelay(once(), 1000), backoff(1000, 1.2), timeout(60_000));
}
Available polling functions are here: https://js.icp.build/core/latest/libs/agent/api/namespaces/strategy/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions