Skip to content

Commit

Permalink
Reset
Browse files Browse the repository at this point in the history
  • Loading branch information
richardr1126 committed Dec 12, 2024
1 parent e43a483 commit 3b4cb79
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions firehose/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,17 @@ def init_client() -> Client:

# Attempt to load existing session from the database
session_string = get_session()
# if session_string:
# try:
# client.login(session_string=session_string)
# logger.info("Reused existing session from the database.")
# except exceptions.AtProtocolError as e:
# logger.error(f"Failed to login with existing session: {e}")
# logger.info("Attempting to create a new session.")
# client.login(HANDLE, PASSWORD)
# else:
logger.info("No existing session found in the database. Creating a new session.")
client.login(HANDLE, PASSWORD)
if session_string:
try:
client.login(session_string=session_string)
logger.info("Reused existing session from the database.")
except exceptions.AtProtocolError as e:
logger.error(f"Failed to login with existing session: {e}")
logger.info("Attempting to create a new session.")
client.login(HANDLE, PASSWORD)
else:
logger.info("No existing session found in the database. Creating a new session.")
client.login(HANDLE, PASSWORD)

return client

Expand Down

0 comments on commit 3b4cb79

Please sign in to comment.