Skip to content

Dynamic adjustment of the backoff depending on the progress. #3

Description

@flybyray

This loop is far too static.
The likelihood of it failing increases with increasing size or after merging content from multiple Confluence instances.
It may not make sense to keep adjusting the retries manually.

for (( c=1; c<=${progress_retries}; c++ )); do
log " * waiting for atlassian ${APP} cloud to finish backup..."
PROGRESS_JSON=$(curl -sSfL -u ${EMAIL}:${API_TOKEN} https://${INSTANCE}/wiki/rest/obm/1.0/getprogress.json || die " * Error while requesting backup generation progress, exiting.")
FILE_NAME=$(echo "$PROGRESS_JSON" | sed -n 's/.*"fileName"[ ]*:[ ]*"\([^"]*\).*/\1/p')
## PRINT BACKUP STATUS INFO ##
# log "$PROGRESS_JSON"
if [[ ${PROGRESS_JSON} == *"error"* ]]; then
break
fi
if [[ ! -z "${FILE_NAME}" ]]; then
break
fi
# Waits for the amount of seconds specified in progress_sleep variable between a check and the other
sleep ${progress_sleep}
done

An improvement would be the implementation of a dynamic adjustment of the backoff depending on the progress.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions