Efficiently manage ShotGrid API connections
server.connection
property or create tools with the @server.tool()
decorator, the Connection Pool is used automatically:
async with
statement ensures the connection is properly returned to the pool, even if an exception occurs.
Parameter | Type | Default | Description |
---|---|---|---|
max_connections | int | 10 | Maximum number of connections in the pool |
connection_timeout | int | 30 | Timeout for ShotGrid API calls (seconds) |
max_retries | int | 3 | Maximum number of retries for failed operations |
retry_delay | float | 1.0 | Delay between retries (seconds) |
health_check_interval | int | 60 | Interval for connection health checks (seconds) |
async with
) to ensure proper release.