"""
return RateLimiterRequest(self.backend, *args, **kwargs)
- async def cleanup(backend):
+ async def cleanup(self):
"""
Called to cleanup the ratelimiter from expired entries
"""
ratelimiter
.delete()
.where(
- ratelimiter.c.expired_at <= sqlalchemy.func.current_timestamp(),
+ ratelimiter.c.expires_at <= sqlalchemy.func.current_timestamp(),
)
)
# Run the query
- await self.db.execute(stmt)
+ async with await self.db.transaction():
+ await self.db.execute(stmt)
class RateLimiterRequest(base.Object):