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

Changing request timeout to infinite for file upload #58

Merged
merged 5 commits into from
Mar 23, 2023

Conversation

bcgv123
Copy link
Contributor

@bcgv123 bcgv123 commented Mar 22, 2023

https://apps.nrs.gov.bc.ca/int/jira/browse/SHOWCASE-3139? Changed the number of milliseconds before timing out the request for file upload only, to infinitive. Adding timeout as input argument at service/store layer, if not passed in defaults to 10000ms.

Used 1GB for testing.

Screenshot 2023-03-22 at 12 30 38 PM

Types of changes

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@bcgv123 bcgv123 marked this pull request as draft March 22, 2023 19:21
@github-actions
Copy link

Coverage Report (Application)

Totals Coverage
Statements: 75% ( 51 / 68 )
Methods: 62.5% ( 5 / 8 )
Lines: 82.61% ( 38 / 46 )
Branches: 57.14% ( 8 / 14 )

@github-actions
Copy link

github-actions bot commented Mar 22, 2023

Coverage Report (Frontend)

Totals Coverage
Statements: 5.51% ( 43 / 780 )
Methods: 0% ( 0 / 181 )
Lines: 8.52% ( 41 / 481 )
Branches: 1.69% ( 2 / 118 )

@bcgv123 bcgv123 marked this pull request as ready for review March 22, 2023 19:31
@bcgv123 bcgv123 force-pushed the fix/3139-big-file-upload-timeout branch from 12509c2 to 50326c6 Compare March 22, 2023 21:31
Copy link
Member

@jujaga jujaga left a comment

Choose a reason for hiding this comment

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

Looking good at a high level w.r.t. overall structure. Just need a consistency/documentation pass and should be good. 👍


/**
* @function comsAxios
* Returns an Axios instance for the COMS API
* @param {number} [timeout=10000] Number of milliseconds before timing out the request
Returns an Axios instance for the COMS API
Copy link
Member

Choose a reason for hiding this comment

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

Looks like a potential indentation issue in the git diff here?

@@ -8,6 +8,7 @@ import { partition } from '@/utils/utils';

import type { Ref } from 'vue';
import type { COMSObject, ObjectSearchPermissionsOptions } from '@/types';
import type { AxiosRequestConfig } from 'axios';
Copy link
Contributor

Choose a reason for hiding this comment

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

External type import. Should come before vue import.

@@ -44,7 +44,8 @@ const onUpload = async (event: any) => {
await Promise.allSettled(
event.files.map(async (file: File) => {
try {
await objectStore.createObject(file, bucketId);
//infinite timeout for big files upload to avoid timeout error
Copy link
Contributor

Choose a reason for hiding this comment

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

Style: missing space after // and capitalization

@kamorel kamorel merged commit fb855b7 into master Mar 23, 2023
@kamorel kamorel deleted the fix/3139-big-file-upload-timeout branch March 23, 2023 18:24
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