Skip to content

Commit e1596e8

Browse files
authored
Merge pull request #286 from unipept/palette-retry-feedback-12170354350089645752
🎨 Palette: Add retry feedback to CLI commands
2 parents b2e6185 + a8b1e94 commit e1596e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/commands/unipept/unipept_subcommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ export abstract class UnipeptSubcommand {
241241

242242
if (shouldRetry) {
243243
// retry with delay
244-
// console.error("retrying");
245-
const delay = 5000 * Math.random();
244+
const delay = Math.ceil(5000 * Math.random());
245+
process.stderr.write(`> Request failed: ${error}. Retrying in ${(delay / 1000).toFixed(1)}s...\n`);
246246
await new Promise(resolve => setTimeout(resolve, delay));
247247
return this.fetchWithRetry(url, options, retries - 1);
248248
} else {

0 commit comments

Comments
 (0)