diff --git a/easyauth/proxy.py b/easyauth/proxy.py index 51a00a5..2388f46 100755 --- a/easyauth/proxy.py +++ b/easyauth/proxy.py @@ -38,7 +38,6 @@ async def global_store_update(action, store, key, value): #trigger all registered functions within #clients namespace client_methods = manager['clients'] - log.warning(f"triggering global_store_update for {client_methods}") for method in client_methods: if method == 'get_store_data': continue @@ -62,8 +61,7 @@ async def global_token_cleanup(): for method in client_methods: if not 'token_cleanup' in method: continue - result = await client_methods[method]() - log.debug(f"global_token_cleanup: cleaned {len(result)} expired tokens") + await client_methods[method]() break # start scheduler in background diff --git a/easyauth/server.py b/easyauth/server.py index 51c11f3..2e2b335 100755 --- a/easyauth/server.py +++ b/easyauth/server.py @@ -558,12 +558,13 @@ async def token_cleanup(self): all_tokens = await Tokens.all() revoked_tokens = [ { - token.token_id: await self.revoke_token(token.token_id) + token.token_id: asyncio.create_task(self.revoke_token(token.token_id)) } for token in all_tokens if datetime.datetime.now() > datetime.datetime.fromisoformat(token.expiration) ] - return revoked_tokens + self.log.warning(f"token_cleanup cleared {len(revoked_tokens)} expired tokens") + return f"finished cleaning {len(revoked_tokens)} expired tokens" async def issue_token(self, permissions, minutes=60, hours=0, days=0):