Skip to content

Commit

Permalink
Revert Google Tasks client changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroCool2u committed Jun 17, 2023
1 parent f0f4d8f commit c340291
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from dash.exceptions import PreventUpdate
from datetime import datetime as dt
from google.cloud import firestore
from google.cloud import tasks_v2 as gtasks
from google.cloud import tasks as gtasks
from google.cloud.exceptions import NotFound
from google.protobuf import timestamp_pb2
from orjson import dumps
Expand Down Expand Up @@ -178,7 +178,7 @@ def schedule_fact_tasks(target_phone: str, target_name: str, fact_type: str, sta
# Construct the request body.
task = {
'app_engine_http_request': { # Specify the type of request.
'http_method': gtasks.HttpMethod.POST,
'http_method': 'POST',
'relative_uri': '/send'
}
}
Expand All @@ -193,12 +193,12 @@ def schedule_fact_tasks(target_phone: str, target_name: str, fact_type: str, sta
queue = 'facts-queue'
location = 'us-east4'
# Construct the fully qualified queue name.
parent = client.queue_path(project=project, location=location, queue=queue)
parent = client.queue_path(project, location, queue)

for t in tasks:
try:
# Use the client to build and send the task.
response = client.create_task(parent=parent, task=t)
response = client.create_task(parent, t)
logging.info('Task creation response: ' + str(response.name))

except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ gunicorn
requests
orjson
email_validator
google-cloud-tasks
google-cloud-tasks<2.0.0
pandas
google-cloud-firestore
phonenumbers

0 comments on commit c340291

Please sign in to comment.