Skip to content

Commit

Permalink
Log first successful RCON connection
Browse files Browse the repository at this point in the history
  • Loading branch information
bostrt committed Feb 6, 2024
1 parent ddbaa54 commit fbe4282
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/palworld_exporter/providers/rcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ def __init__(self, host, port, password, timeout=10):
self._port = port
self._password = password
self._timeout = timeout
self._first_connection_made = False

def _get_console(self):
return Console(self._host, self._password, self._port, self._timeout)

def __enter__(self) -> Console:
self._console = self._get_console()
if not self._first_connection_made:
logging.info('RCON Connection success')
self._first_connection_made = True
logging.debug('RCON collector opened connection')
return self._console

Expand Down

0 comments on commit fbe4282

Please sign in to comment.