We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 204ab27 commit 920bd5fCopy full SHA for 920bd5f
scripts/text_files/python_stubs_py_template.txt
@@ -4,6 +4,10 @@
4
{{ Services class code }}
5
6
7
+from os import environ
8
+USE_LOCALHOST = environ.get('AIAAS_GRPC_USE_LOCALHOST', 'False').lower() == 'true'
9
+
10
def get_stub(config: dict):
- channel = grpc.insecure_channel(config['host'] + ':' + str(config['port']))
11
+ host = '127.0.0.1' if USE_LOCALHOST else config['host']
12
+ channel = grpc.insecure_channel(host + ':' + str(config['port']))
13
return config['stub_class'](channel)
0 commit comments