rye / eb Goto Github PK
View Code? Open in Web Editor NEWβ»οΈ Run commands with exponential backoff π
License: GNU General Public License v3.0
β»οΈ Run commands with exponential backoff π
License: GNU General Public License v3.0
This is one big main
function with all the logic in it besides clamping. This should be changed.
so allow some exit codes to be non retriable
For example, if after #3 I specify a SlotTime
of 1s and my command takes 500ms, a sleep of 0 slots of length should last 0ms, whereas a sleep of 1 should last 500ms.
I'm not sure I like this design, but it'd certainly be more real-time.
I could also see just subtracting from the delay the time that elapsed during execution, then clamping with a lower bound of 0ns to prevent panics.
This is not good behavior.
It's far better to make main return a Result
that can be coerced to std::process::Termination
; this is a far cleaner way of doing things anyhow.
This will, as written currently, prevent SlotTime::UserSpecified
from being changed as the slot time executes somewhat slowly.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
Cargo.toml
anyhow 1
clap 4
simple_logger 4
log 0.4.20
rand 0.8.5
thiserror 1
.github/workflows/release.yml
actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
actions-rs/cargo v1@844f36862e911db73fe0815f00a4a2602c279505
.github/workflows/test.yml
actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
actions/upload-artifact v4@5d5d22a31266ced268874388b861e4b58bb5c2f3
For example, eb -x 16
will only allow the command to be run 16 times.
It'd be far better, in my opinion, to launch sh -c
with the arguments that are passed joined by a " "
. This is what watch(1)
does, so it wouldn't be too outlandish.
This might also let us drop the AppSettings::AllowExternalSubcommands
and instead just accept all unmatched arguments as things to be joined when getting passed to sh -c
.
clap
sh -c
with arguments populated by our argvI would like to figure out how to test this.
I think part of this will be extracting a runtime into more modular/testable code. I should also try to do integration tests.
Currently, all eb
does is run a command.
It'd Be Niceβ’ if, instead, eb
could also watch for activity.
For example, if I run eb ssh <server that is restarting>
, I'd like to be able to have it wait until some kind of trigger is hit, like new console output or network activity or something.
Currently, the loop
just waits until the command fully completes and checks the status code.
eb
itself and let the child process become its own?When doing prerelease testing for v0.4.0, I noticed that eb
no longer accepts a command to run:
> cargo run -- --help
[...]
Running `target/debug/eb --help`
eb 0.4.0-dev
Kristofer Rye <[email protected]>
A command executor exercising exponential backoff
USAGE:
eb [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-x <max> limits the number of times command is executed
Notice, in the above, that there isn't any mention of subcommands, as there is in v0.3.5:
> eb --help
eb 0.3.5
Kristofer Rye <[email protected]>
A command executor exercising exponential backoff
USAGE:
eb [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
I believe this was caused by #82. I'll be working on a fix before releasing v0.4.0.
Set up CI.
I would like to have some integration tests, too, not just unit tests.
Part of this can be serviced by the tests/
subdirectory. I can write a script (or something) that monitors when and how eb
calls it.
Also, I'd like to keep track of all of the user-facing parts (usage, output)
log!
invocations?A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.