Skip to content

Commit

Permalink
feat: add dispatch_deadline parameter to tasks_v2.Task
Browse files Browse the repository at this point in the history
  • Loading branch information
frnsimoes committed Jan 23, 2025
1 parent 933a112 commit a5ce055
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gcp_pilot/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def push(
use_oidc_auth: bool = True,
content_type: str | None = None,
headers: dict[str, str] | None = None,
dispatch_deadline: int | None = None,
) -> tasks_v2.Task:
queue_path = self.client.queue_path(
project=project_id or self.project_id,
Expand Down Expand Up @@ -81,6 +82,9 @@ def push(
),
)

if dispatch_deadline is not None:
task.dispatch_deadline = dispatch_deadline

if delay_in_seconds:
target_date = datetime.now(tz=UTC) + timedelta(seconds=delay_in_seconds)
timestamp = timestamp_pb2.Timestamp()
Expand Down

0 comments on commit a5ce055

Please sign in to comment.