MCPcopy Create free account
hub / github.com/apify/crawlee-python / main

Function main

docs/guides/code_examples/session_management/sm_standalone.py:6–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6async 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
24if __name__ == '__main__':

Callers 1

sm_standalone.pyFile · 0.70

Calls 5

SessionPoolClass · 0.90
mark_badMethod · 0.80
retireMethod · 0.80
mark_goodMethod · 0.80
get_sessionMethod · 0.45

Tested by

no test coverage detected