Retry policies broken in 2.0.0
tomasAlabes opened this issue · comments
Tomas Alabes commented
A policy creation like Policy.handleAll().retry().backoff(new ConstantBackoff(2000, 10))
fails with the following error:
Argument of type 'ConstantBackoff' is not assignable to parameter of type 'IBackoff<IRetryBackoffContext<unknown>>'.
Property 'duration' is missing in type 'ConstantBackoff' but required in type 'IBackoff<IRetryBackoffContext<unknown>>'.
.retry().backoff(new ConstantBackoff(2000, 10))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/cockatiel/dist/backoff/Backoff.d.ts:18:14
18 readonly duration: number;
~~~~~~~~
'duration' is declared here.
It works in version 1.1.1
.
Node 12.19.1
Typescript 4.1.2
Connor Peet commented
Thanks, fixed in 2.0.1