-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into develop-8T-compress-batch
- Loading branch information
Showing
25 changed files
with
1,233 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Time in seconds to backoff after the initial attempt. | ||
INITIAL_BACKOFF=10 | ||
|
||
# Grab first arg as number of retries | ||
retries=$1 | ||
shift | ||
|
||
# Use for loop to repeatedly try the wrapped command, breaking on success | ||
for i in $(seq 1 $retries); do | ||
echo "Running: $@" | ||
|
||
# Exponential backoff | ||
if [[ i -gt 1 ]]; then | ||
# Starts with the initial backoff then doubles every retry. | ||
backoff=$(($INITIAL_BACKOFF * (2 ** (i - 2)))) | ||
echo "Command failed, retrying in $backoff seconds..." | ||
sleep $backoff | ||
fi | ||
|
||
# Run wrapped command, and exit on success | ||
$@ && break | ||
result=$? | ||
done | ||
|
||
# Exit with status code of wrapped command | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.DS_Store | ||
.DS_Store/ | ||
|
||
# Linter | ||
megalinter-reports/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.