Skip to content

Commit

Permalink
Fix reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed May 31, 2024
1 parent d5be2de commit 8b027ad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/zinolib/controllers/zino1.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def close_push_channel(session):

@classmethod
def close_session(cls, session):
cls.close_push_channel()
cls.close_push_channel(session)
session.request.close()
session.request = None
return None
Expand Down Expand Up @@ -492,6 +492,7 @@ class Zino1EventManager(EventManager):
_history_adapter = HistoryAdapter
_log_adapter = LogAdapter
removed_ids: Set[int] = set()
config = None

@property
def is_authenticated(self):
Expand Down Expand Up @@ -520,10 +521,13 @@ def _verify_session(self, quiet=False):
@classmethod
def configure(cls, config):
session = cls._session_adapter.create_session(config)
return cls(session)
classobj = cls(session)
classobj.config = config
return classobj

def connect(self):
self._verify_session()
if not self._verify_session(quiet=True):
self.session = self._session_adapter.create_session(self.config)
self.session = self._session_adapter.connect_session(self.session)

def connect_push_channel(self):
Expand Down

0 comments on commit 8b027ad

Please sign in to comment.