Files
apify--crawlee/docs/guides/session_management_standalone.ts
2026-07-13 13:23:39 +08:00

22 lines
464 B
TypeScript

import { SessionPool } from 'crawlee';
// Override the default Session pool configuration.
const sessionPoolOptions = {
maxPoolSize: 100,
};
// Open Session Pool.
const sessionPool = await SessionPool.open(sessionPoolOptions);
// Get session.
const session = await sessionPool.getSession();
// Increase the errorScore.
session.markBad();
// Throw away the session.
session.retire();
// Lower the errorScore and mark the session good.
session.markGood();