Skip to content

Commit f821f64

Browse files
committed
Merge pull request #245 from rory/configurable-fetching-delay
Optional ability to control how long fetch_osc waits between download attemps
2 parents 71d68ff + 89504fe commit f821f64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/fetch_osc.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919

2020
if [[ -z $1 ]]; then
2121
{
22-
echo Usage: $0 Replicate_id Source_dir Local_dir
22+
echo Usage: $0 Replicate_id Source_dir Local_dir [Sleep]
2323
exit 0
2424
};
2525
fi
2626

2727
REPLICATE_ID=$1
2828
SOURCE_DIR=$2
2929
LOCAL_DIR=$3
30+
SLEEP_BETWEEN_DLS=${4:-15} # How long to sleep between download attempts (sec). Default: 15
3031

3132
if [[ ! -d $LOCAL_DIR ]];
3233
then {
@@ -53,7 +54,7 @@ retry_fetch_file()
5354
}; fi
5455
}; fi
5556
until [[ -s "$2" ]]; do {
56-
sleep 15
57+
sleep $SLEEP_BETWEEN_DLS
5758
fetch_file "$1" "$2"
5859
if [[ "$3" == "gzip" ]]; then {
5960
gunzip -t <"$2"

0 commit comments

Comments
 (0)