prefect.server.models.concurrency_limits
Functions for interacting with concurrency limit ORM objects. Intended for internal use by the Prefect REST API.
filter_concurrency_limits_for_orchestration(session, tags)
async
Filters concurrency limits by tag. This will apply a "select for update" lock on these rows to prevent simultaneous read race conditions from enabling the the concurrency limit on these tags from being temporarily exceeded.
Source code in src/prefect/server/models/concurrency_limits.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
read_concurrency_limit(session, concurrency_limit_id)
async
Reads a concurrency limit by id. If used for orchestration, simultaneous read race conditions might allow the concurrency limit to be temporarily exceeded.
Source code in src/prefect/server/models/concurrency_limits.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
read_concurrency_limit_by_tag(session, tag)
async
Reads a concurrency limit by tag. If used for orchestration, simultaneous read race conditions might allow the concurrency limit to be temporarily exceeded.
Source code in src/prefect/server/models/concurrency_limits.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
read_concurrency_limits(session, limit=None, offset=None)
async
Reads a concurrency limits. If used for orchestration, simultaneous read race conditions might allow the concurrency limit to be temporarily exceeded.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AsyncSession
|
A database session |
required |
offset
|
Optional[int]
|
Query offset |
None
|
limit
|
Optional[int]
|
Query limit |
None
|
Returns:
Type | Description |
---|---|
Sequence[ConcurrencyLimit]
|
List[orm_models.ConcurrencyLimit]: concurrency limits |
Source code in src/prefect/server/models/concurrency_limits.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
reset_concurrency_limit_by_tag(session, tag, slot_override=None)
async
Resets a concurrency limit by tag.
Source code in src/prefect/server/models/concurrency_limits.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|