Skip to content

Commit e28a3e3

Browse files
committed
fix task name set to none
1 parent 1e7f3a9 commit e28a3e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

api/src/shared/common/gcp_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ def create_http_task_with_name(
8383
logging.info("Queue parent path: %s", parent)
8484

8585
task = tasks_v2.Task(
86-
name=f"{parent}/tasks/{task_name}",
86+
# If task_name is provided, it will be used; otherwise, a unique name will be generated.
87+
# The task_name should be unique to avoid conflicts.
88+
# If task_name is None, the Cloud Tasks service will generate a unique name.
89+
# This is useful for deduplication purposes.
90+
name=f"{parent}/tasks/{task_name}" if task_name else None,
8791
schedule_time=task_time,
8892
http_request=tasks_v2.HttpRequest(
8993
url=url,

0 commit comments

Comments
 (0)