Commit d71a90b
Changed files (3)
.github/workflows/v7-publish.yml
@@ -29,4 +29,4 @@ jobs:
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
env:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
- - run: npm publish --provenance --access=public --no-git-tag-version --tag v-7
+ - run: npm publish --provenance --access=public --no-git-tag-version --tag legacy
src/goods.ts
@@ -166,13 +166,15 @@ export async function retry<T>(
throw lastErr
}
-export function* expBackoff(max: Duration = '60s', rand: Duration = '100ms') {
+export function* expBackoff(
+ max: Duration = '60s',
+ delay: Duration = '100ms'
+): Generator<number, void, unknown> {
const maxMs = parseDuration(max)
- const randMs = parseDuration(rand)
- let n = 1
+ const randMs = parseDuration(delay)
+ let n = 0
while (true) {
- const ms = Math.floor(Math.random() * randMs)
- yield Math.min(2 ** n++, maxMs) + ms
+ yield Math.min(randMs * 2 ** n++, maxMs)
}
}
README.md
@@ -37,7 +37,7 @@ gives sensible defaults.
## Install
```bash
-npm install zx@7 # or npm install zx@v-7
+npm install zx
```
**Requirement**: Node.js >= 16.0.0