()
| 4 | |
| 5 | |
| 6 | async def main() -> None: |
| 7 | # Override the default Session pool configuration. |
| 8 | async with SessionPool( |
| 9 | max_pool_size=100, |
| 10 | create_session_settings={'max_usage_count': 10, 'blocked_status_codes': [403]}, |
| 11 | ) as session_pool: |
| 12 | session = await session_pool.get_session() |
| 13 | |
| 14 | # Increase the error_score. |
| 15 | session.mark_bad() |
| 16 | |
| 17 | # Throw away the session. |
| 18 | session.retire() |
| 19 | |
| 20 | # Lower the error_score and mark the session good. |
| 21 | session.mark_good() |
| 22 | |
| 23 | |
| 24 | if __name__ == '__main__': |
no test coverage detected