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

Improve handling of full items #297

Closed
wants to merge 2 commits into from

Conversation

AGSPhoenix
Copy link

Show a warning message when an upload fails due to a ConnectionError, as is the case when the item is full. --status-check now checks for this. These two changes make the underlying issue in #290 more clear.

This is just about the minimum useful PR I could put together in a short time. I'm not really familiar with all the different uses of ia, so wasn't really sure how to properly signal the failure of a single upload for bulk uploads and the like. I'd like to improve on this later if time allows, but this is better than nothing.

@AGSPhoenix
Copy link
Author

Oh yeah, fixes #293 as well

Copy link
Contributor

@anarcat anarcat left a comment

Choose a reason for hiding this comment

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

the little number there could use an explanation, otherwise LGTM.

@@ -176,6 +181,10 @@ def main(argv, session):
'Expect 503 SlowDown errors.'.format(args['<identifier>']),
file=sys.stderr)
sys.exit(1)
elif get_item('{0}'.format(args['<identifier>'])).item_size >= 1099511627776:
Copy link
Contributor

Choose a reason for hiding this comment

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

could we use a global, in capitals, at the top of the file here instead of this magic number? something like:

IA_MAX_SIZE = 1099511627776

or even better, what the actual value means:

# one tibibyte
IA_MAX_SIZE = 2^40

Copy link
Owner

Choose a reason for hiding this comment

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

I agree with @anarcat. Also, we already initialize the item on https://github.com/jjjake/internetarchive/blob/master/internetarchive/cli/ia_upload.py#L183, this check should happen after that so we only have to do it once.

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.

3 participants