Skip to content

run long requests on second thread #1212

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

Merged
merged 15 commits into from
Apr 19, 2023

Conversation

jacalata
Copy link
Contributor

added a thread for the request, so we can continue giving progress updates on the UI while downloading.
added tests - could do with more

Was not able to repro the original issue (ran into other problems with a large file) so this may not help, but it should at least capture more logs of the failure.

jacalata added 11 commits March 24, 2023 23:46
added a thread for the request, so we can continue giving progress updates on the UI
added tests - could do with more
Also begins extracting constants for user editing
Configure it centrally. Still needs work to let the calling user configure it.
@jacalata
Copy link
Contributor Author

Note for review: this does contain 78 files, but
a) ignore all the samples files, it's just an argument change. Exception: to see the new behavior, run publish_datasource.py
b) of the files under /models or /server/endpoints, almost all of them have just changed how they import the logger. You mostly just need to look at datasources_endpoint, endpoint, and fileuploads_endpoint

@@ -262,7 +271,11 @@ def publish(

# Determine if chunking is required (64MB is the limit for single upload method)
if file_size >= FILESIZE_LIMIT:
logger.info("Publishing {0} to server with chunking method (datasource over 64MB)".format(filename))
logger.info(
"Publishing {} to server with chunking method (datasource over {}MB, chunk size {}MB)".format(

Choose a reason for hiding this comment

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

Are FILESIZE_LIMIT and CHUNK_SIZE in bytes, not MB?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, yea

logger.debug("{} Waiting....".format(datetime.timestamp()))
if minutes % 5 == 0 and seconds >= 60:
logger.info("[{}] Waiting ({} minutes so far) for request to {}".format(datetime.timestamp(), minutes, url))
elif minutes % 1 == 0 and seconds >= 60:

Choose a reason for hiding this comment

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

Was this supposed to be minutes == 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, originally I was just logging every minute and then I added the longer message every 5 minutes and borked the checks

@jacalata jacalata force-pushed the jac/tfs-1504654-giant-publishing branch from c2af35f to cbba950 Compare April 18, 2023 23:35
@jacalata jacalata merged commit 3cc28be into development Apr 19, 2023
@jacalata jacalata deleted the jac/tfs-1504654-giant-publishing branch April 19, 2023 02:59
jacalata added a commit that referenced this pull request Apr 24, 2023
TableauIDWithMFA added to the user_item model to allow creating users on Tableau Cloud with MFA enabled (#1217)
Run long requests on second thread (#1212)
#1210
#1087
#1058
#456
#1209
update datasource to use bridge (#1224)


Co-authored-by: Tim Payne <47423639+ma7tcsp@users.noreply.github.com>
jacalata added a commit that referenced this pull request Sep 22, 2023
* run long requests on second thread
* improve chunked upload requests
* begin extracting constants for user editing
* centrally configured logger
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.

2 participants