File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
- # Third Party Imports
1
+ # Standard Library Imports
2
+ import os
2
3
from typing import Any
3
4
5
+ # Third Party Imports
4
6
import grpc
5
7
from google .api_core .exceptions import AlreadyExists
6
8
from google .cloud import scheduler_v1 , tasks_v2
@@ -42,8 +44,9 @@ def ensure_queue(
42
44
pass
43
45
44
46
45
- def emulator_client (* , host : str = "localhost:8123" ) -> tasks_v2 .CloudTasksClient :
47
+ def emulator_client () -> tasks_v2 .CloudTasksClient :
46
48
"""Helper function to create a CloudTasksClient from an emulator host."""
49
+ host = os .getenv ("CLOUD_TASKS_EMULATOR_HOST" , "localhost:8124" )
47
50
channel = grpc .insecure_channel (host )
48
51
transport = transports .CloudTasksGrpcTransport (channel = channel )
49
52
return tasks_v2 .CloudTasksClient (transport = transport )
You can’t perform that action at this time.
0 commit comments