Skip to content

Commit

Permalink
Fix redundant reassignment in connection attempt loop
Browse files Browse the repository at this point in the history
Removed unnecessary reassignment of 'conn' in the connection attempt loop. This change cleans up the code by ensuring 'conn' is only connected without reassigning it unnecessarily.

Signed-off-by: Jose Borreguero <borreguero@gmail.com>
  • Loading branch information
jmborr committed Aug 29, 2024
1 parent 5279544 commit 2a357c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webmonchow/amq/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def connect_to_broker(broker, user, password, attempts=None, interval=5.0):
attempt_number = 0
while attempts is None or attempt_number < attempts:
try:
conn = conn.connect(user, password, wait=True)
conn.connect(user, password, wait=True)
print(f"Connected to {broker}")
return conn
except stomp.exception.ConnectFailedException as e:
Expand Down

0 comments on commit 2a357c9

Please sign in to comment.