Skip to content

Commit

Permalink
Adjust logging for filtered out accounts, more info.
Browse files Browse the repository at this point in the history
So we can spend less time on Discord :-P
  • Loading branch information
JabLuszko authored Apr 19, 2024
1 parent cd3fb2c commit d3a6c3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mapadroid/account_handler/AccountHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ async def get_account(self, device_id: int, purpose: AccountPurpose,
# TODO: Filter only unassigned or assigned to same device first
logins: Dict[int, SettingsPogoauth] = await SettingsPogoauthHelper.get_avail_accounts(
session, self._db_wrapper.get_instance_id(), auth_type=None, device_id=device_id)
logger.info("Got {} before filtering for burnt or not fitting the usage.", len(logins))
# Filter all burnt and all which do not match the purpose. E.g., if the purpose is mon scanning.
logins_filtered: List[SettingsPogoauth] = [auth_entry for auth_id, auth_entry in logins.items()
if not self._is_burnt(auth_entry)
and self._is_usable_for_purpose(auth_entry,
purpose, location_to_scan)]
logins_filtered.sort(key=lambda x: DatetimeWrapper.fromtimestamp(0) if x.last_burn is None else x.last_burn)
logger.info("Got {} before filtering (burnt, wrong level) and {} after", len(logins), len(logins_filtered))
login_to_use: Optional[SettingsPogoauth] = None
if not logins_filtered:
logger.warning("No auth found for {}", device_id)
Expand Down

0 comments on commit d3a6c3f

Please sign in to comment.