From 0ab7b8ca6d7795e5bece95bd6653583acbeec584 Mon Sep 17 00:00:00 2001 From: Amund Isaksen <31344542+Teddy-1000@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:36:54 +0200 Subject: [PATCH] Update grpc_getter.py (#157) * Update grpc_getter.py * Fix formatting * Update main.py --- api/grpc_getter.py | 5 ++++- ingest/api/main.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/grpc_getter.py b/api/grpc_getter.py index 25047b3e..414bd6b9 100644 --- a/api/grpc_getter.py +++ b/api/grpc_getter.py @@ -12,7 +12,10 @@ # Reuse channel and stub as much as possible, see https://grpc.io/docs/guides/performance/ @cache def get_grpc_stub(): - channel = grpc.aio.insecure_channel(f"{os.getenv('DSHOST', 'localhost')}:{os.getenv('DSPORT', '50050')}") + channel = grpc.aio.insecure_channel( + f"{os.getenv('DSHOST', 'localhost')}:{os.getenv('DSPORT', '50050')}", + options=[("grpc.max_receive_message_length ", int(os.getenv("GRPC_MAX_MESSAGE_SIZE", 4096)))], + ) return dstore_grpc.DatastoreStub(channel) diff --git a/ingest/api/main.py b/ingest/api/main.py index eb649002..6293a155 100644 --- a/ingest/api/main.py +++ b/ingest/api/main.py @@ -27,7 +27,7 @@ class Response(BaseModel): "username": os.getenv("MQTT_USERNAME"), "password": os.getenv("MQTT_PASSWORD"), "enable_tls": os.getenv("MQTT_TLS", "False").lower() in ("true", "1", "t"), - "port": os.getenv("MQTT_PORT", 8883), + "port": int(os.getenv("MQTT_PORT", 8883)), }