Skip to content

Commit

Permalink
Retry every failed request two times.
Browse files Browse the repository at this point in the history
A failed request is either a timeout or a status code 5xx.

This refs #22, #15.
This closes #8.
  • Loading branch information
fkalis committed Mar 11, 2016
1 parent 60aadcb commit 3569b10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions onedrive-base
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
api_auth_url="https://login.live.com/oauth20_token.srf"
api_base_url="https://api.onedrive.com/v1.0"
get_json_value="cut -d= -f2-"
curl_opts="--silent"
curl_opts="--silent --retry 2 --retry-delay 10"

function error() {
echo "$1" >&2
Expand Down Expand Up @@ -245,12 +245,12 @@ function onedrive_acquire_access_token() {
# --- UPLOAD SESSION MANAGEMENT --- #
# --------------------------------- #
# $1=file
function filesystem_get_filesize() {
function filesystem_get_filesize() {
if [[ $(uname) == "Darwin" ]]; then
stat -f%z "$1"
else
du -b "$1" | cut -f1
fi
fi
}

# $1=folder id
Expand Down

0 comments on commit 3569b10

Please sign in to comment.