Skip to content

Commit 96194a9

Browse files
author
Alan Christie
committed
fix: Removed confusing global variables
1 parent 8df2b7f commit 96194a9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

app/app.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,11 @@ def _get_location(uuid: str) -> str:
134134
_EVENT_STREAMS = _RES.fetchall()
135135
_DB_CONNECTION.close()
136136
for _ES in _EVENT_STREAMS:
137-
routing_key: str = _ES[2]
138-
ess_uuid: str = _ES[1]
139137
_LOGGER.info(
140138
"Existing EventStream: %s (id=%s routing_key=%s)",
141139
_get_location(_ES[1]),
142140
_ES[0],
143-
routing_key,
141+
_ES[2],
144142
)
145143

146144

@@ -335,15 +333,15 @@ async def event_stream(
335333
es_routing_key,
336334
uuid,
337335
)
338-
existing_routing_key_uuid: str = _MEMCACHED_CLIENT.get(routing_key)
339-
if existing_routing_key_uuid and existing_routing_key_uuid != new_socket_uuid:
336+
existing_socket_uuid: str = _MEMCACHED_CLIENT.get(es_routing_key)
337+
if existing_socket_uuid and existing_socket_uuid != new_socket_uuid:
340338
_LOGGER.warning(
341339
"Replaced routing key %s WebSocket unique ID (%s) with ours (%s)",
342-
routing_key,
343-
existing_routing_key_uuid,
340+
es_routing_key,
341+
existing_socket_uuid,
344342
new_socket_uuid,
345343
)
346-
_MEMCACHED_CLIENT.set(routing_key, new_socket_uuid)
344+
_MEMCACHED_CLIENT.set(es_routing_key, new_socket_uuid)
347345

348346
# Start consuming the stream.
349347
# We don't return from here until there's an error.

0 commit comments

Comments
 (0)