Add type hints for account validity handler (#8620)

This also fixes a bug by fixing handling of an account which doesn't expire.
This commit is contained in:
Patrick Cloke 2020-10-26 14:17:31 -04:00 committed by GitHub
parent 66e6801c3e
commit 10f45d85bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 12 deletions

View file

@ -240,13 +240,13 @@ class RegistrationWorkerStore(CacheInvalidationWorkerStore):
desc="get_renewal_token_for_user",
)
async def get_users_expiring_soon(self) -> List[Dict[str, int]]:
async def get_users_expiring_soon(self) -> List[Dict[str, Any]]:
"""Selects users whose account will expire in the [now, now + renew_at] time
window (see configuration for account_validity for information on what renew_at
refers to).
Returns:
A list of dictionaries mapping user ID to expiration time (in milliseconds).
A list of dictionaries, each with a user ID and expiration time (in milliseconds).
"""
def select_users_txn(txn, now_ms, renew_at):