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

Exponential back-off for process restarting #462

Merged
merged 2 commits into from
Jan 12, 2024
Merged

Conversation

gustavohenke
Copy link
Member

Title.

$ conc --restart-tries 4 --restart-after exponential "date && exit 1"
[0] Fri 12 Jan 2024 14:10:56 -03
[0] date && exit 1 exited with code 1
[0] date && exit 1 restarted
[0] Fri 12 Jan 2024 14:10:57 -03
[0] date && exit 1 exited with code 1
[0] date && exit 1 restarted
[0] Fri 12 Jan 2024 14:10:59 -03
[0] date && exit 1 exited with code 1
[0] date && exit 1 restarted
[0] Fri 12 Jan 2024 14:11:03 -03
[0] date && exit 1 exited with code 1
[0] date && exit 1 restarted
[0] Fri 12 Jan 2024 14:11:11 -03
[0] date && exit 1 exited with code 1

Closes #265

@gustavohenke gustavohenke added this to the v9 milestone Jan 12, 2024
@coveralls
Copy link

coveralls commented Jan 12, 2024

Coverage Status

coverage: 99.322% (+0.006%) from 99.316%
when pulling 597a1f8 on exponential-backoff
into aedebc1 on main.

Comment on lines +15 to +18

// Don't use TestScheduler as it's hardcoded to a max number of "frames" (time),
// which don't work for some tests in this suite
scheduler = new VirtualTimeScheduler();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/flow-control/restart-process.ts Outdated Show resolved Hide resolved
@gustavohenke gustavohenke merged commit bb8436b into main Jan 12, 2024
21 checks passed
@gustavohenke gustavohenke deleted the exponential-backoff branch January 12, 2024 20:14
@mscottnelson
Copy link

Very nice! Looks great! Thank you for adding this feature

@gustavohenke
Copy link
Member Author

🚢 This is now available in v9.0.0!
https://github.com/open-cli-tools/concurrently/releases/tag/v9.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Exponential backoff
3 participants