Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented simple image download retry #261

Closed
wants to merge 5 commits into from
Closed

Conversation

Beanow
Copy link

@Beanow Beanow commented Oct 18, 2015

I had a crash on this point before due to a server error, so I figured a simple retry would help.

@@ -1058,53 +1065,85 @@ def generateImageDump(config={}, other={}, images=[], start='', session=None):
if not os.path.isdir(imagepath):
print 'Creating "%s" directory' % (imagepath)
os.makedirs(imagepath)


maxseconds = 100 # max seconds to wait in a single sleeping
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put this as something that the user can configure, or should we enforce this as a hard limit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's currently a fixed value for the XML part as well.
I've only followed that. The number of retries is configurable though.


while not completed:
if retried > 0 and retried < maxretries:
wait = increment * retried < maxseconds and increment * \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place the code in one line and the comments should precede the code.

@Beanow
Copy link
Author

Beanow commented Oct 18, 2015

Forgot github updates pull requests automatically. The later commits were not intended for the PR.
Reopened it there.

@Beanow Beanow mentioned this pull request Oct 18, 2015
@Beanow Beanow closed this Oct 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants