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

[ASOC-2714] fix multipart code and chun ksize #25

Merged
merged 3 commits into from
Jun 12, 2024
Merged

Conversation

facundoArgeniss
Copy link
Contributor

@facundoArgeniss facundoArgeniss commented Jun 11, 2024

Bug fix: SDK Errors On Large Files.

Solution based on this thread in StackOverflow https://stackoverflow.com/questions/70131487/an-error-occurred-entitytoosmall-when-calling-the-completemultipartupload-oper

def upload_file_for_binary_analysis(token, organization_context, test_id=None, file_path=None,
chunk_size=1024 * 1024 * 1024 * 5, quick_scan=False):
def upload_file_for_binary_analysis(
token, organization_context, test_id=None, file_path=None, chunk_size=1024**2 * 1000, quick_scan=False
Copy link
Collaborator

@KK7NZY KK7NZY Jun 11, 2024

Choose a reason for hiding this comment

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

To enhance readability and maintainability, I recommend defining this value chunk_size as a constant at the beginning of the script or into another module.

if not test_id:
raise ValueError("Test Id is required")
if not file_path:
raise ValueError("File Path is required")
if chunk_size < 1024**2 * 5:
Copy link
Collaborator

@KK7NZY KK7NZY Jun 11, 2024

Choose a reason for hiding this comment

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

Recommend moving these values to a constant at the beginning of this script or to another module.

@facundoArgeniss facundoArgeniss merged commit be73a05 into main Jun 12, 2024
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