Skip to content

Commit

Permalink
Change log line for filtering accounts (#1382)
Browse files Browse the repository at this point in the history
* Adjust logging for filtered out accounts, more info.

So we can spend less time on Discord :-P

* Update AccountHandler.py
  • Loading branch information
JabLuszko authored Sep 20, 2024
1 parent e846590 commit 6e4e58c
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 and {} after (burnt, wrong level)", 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 6e4e58c

Please sign in to comment.