Skip to content

Commit 6ba25f3

Browse files
committed
move internal login cooldown check
1 parent 07b359c commit 6ba25f3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

siegeapi/auth.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,15 @@ def load_creds(self) -> None:
152152
self.expiration = data.get("expiration", "")
153153
self.new_expiration = data.get("new_expiration", "")
154154

155+
self._login_cooldown = 0
156+
155157
async def connect(self, _new: bool = False) -> None:
156158
""" Connect to Ubisoft, automatically called when needed """
159+
self.load_creds()
160+
157161
if self._login_cooldown > time.time():
158162
raise FailedToConnect("Login on cooldown")
159163

160-
self.load_creds()
161-
162164
# If keys are still valid, don't connect again
163165
if _new:
164166
if self.new_key and datetime.fromisoformat(self.new_expiration[:26]+"+00:00") > datetime.now(timezone.utc):

0 commit comments

Comments
 (0)