Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aybabtme/untilitworks
Retry some command until it works.
https://github.com/aybabtme/untilitworks
Last synced: 18 days ago
JSON representation
Retry some command until it works.
- Host: GitHub
- URL: https://github.com/aybabtme/untilitworks
- Owner: aybabtme
- License: mit
- Created: 2016-01-28T23:07:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-29T02:49:13.000Z (almost 9 years ago)
- Last Synced: 2024-10-14T18:08:03.555Z (about 1 month ago)
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 47
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# until it works
Retry some command until it works.
```
$ untilitworks curl http://mywebsite.com
```## usage
Exponential backoff (with random jitter):
```
$ untilitworks -retry exponentially exit 1
untilitworks: it failed! retrying in 583.112038ms
untilitworks: it failed! retrying in 1.447272331s
untilitworks: it failed! retrying in 1.819838229s
untilitworks: it failed! retrying in 2.514838034s
untilitworks: it failed! retrying in 9.191532459s
```Constant backoff:
```
$ untilitworks -retry constant exit 1
untilitworks: it failed! retrying in 1s
untilitworks: it failed! retrying in 1s
untilitworks: it failed! retrying in 1s
```## installation
### linux
```bash
wget -qO- https://github.com/aybabtme/untilitworks/releases/download/0.2/untilitworks_linux.tar.gz | tar xvz
```### darwin
```bash
wget -qO- https://github.com/aybabtme/untilitworks/releases/download/0.2/untilitworks_darwin.tar.gz | tar xvz
```## halp!
```bash
Usage of untilitworks:
-exp.cap duration
max time to backoff for (default 30s)
-exp.factor float
backoff factor for exponential retries (default 2)
-q whether to suppress the command's output
-retry string
retry type, one of 'c'/'constantly' or 'e'/'exponentially' (default "constantly")
-sleep duration
how long to sleep between retries (base duration for exponential) (default 1s)
```## license
MIT