Skip to content

Commit

Permalink
Allow longer timeout
Browse files Browse the repository at this point in the history
greg-finley committed Mar 11, 2024
1 parent a54e321 commit 2433093
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_process_file.yml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ jobs:
source_dir: "process_file"
memory_mb: 4096
secret_environment_variables: "MYSQL_CONFIG=projects/greg-finley/secrets/MYSQL_CONFIG/versions/latest,DROPBOX_ACCESS_TOKEN=projects/greg-finley/secrets/DROPBOX_ACCESS_TOKEN/versions/latest"
timeout: 120
timeout: 540
event_trigger_type: "providers/cloud.pubsub/eventTypes/topic.publish"
event_trigger_resource: "projects/greg-finley/topics/dropbox-backup"
event_trigger_service: "pubsub.googleapis.com"
4 changes: 3 additions & 1 deletion process_file/main.py
Original file line number Diff line number Diff line change
@@ -28,7 +28,9 @@ def run(event, context):
dropbox_file = dbx.files_download("/" + filename)
content_type = dropbox_file[1].headers.get("Content-Type")
gcs_file = gcs_bucket.blob(filename)
gcs_file.upload_from_string(dropbox_file[1].content, content_type=content_type)
gcs_file.upload_from_string(
dropbox_file[1].content, content_type=content_type, timeout=400
)
query = """
INSERT INTO dropbox (desktop_path, filename, status)
VALUES (%s, SUBSTRING_INDEX(%s, '/', -1), 'done')

0 comments on commit 2433093

Please sign in to comment.