mainframe.endpoints.job ======================= .. py:module:: mainframe.endpoints.job Attributes ---------- .. autoapisummary:: mainframe.endpoints.job.router mainframe.endpoints.job.logger Functions --------- .. autoapisummary:: mainframe.endpoints.job.get_jobs Module Contents --------------- .. py:data:: router .. py:data:: logger :type: structlog.stdlib.BoundLogger .. py:function:: get_jobs(session: Annotated[sqlalchemy.orm.Session, Depends(get_db)], auth: Annotated[mainframe.json_web_token.AuthenticationData, Depends(validate_token)], state: Annotated[mainframe.rules.Rules, Depends(get_rules)], batch: int = 1) -> list[mainframe.models.schemas.JobResult] Request one or more releases to work on. Clients can specify the number of jobs they want to be given using the `batch` query string parameter. If omitted, it defaults to `1`. Clients are assigned the oldest release in the queue, i.e., the release with the oldest `queued_at` time. We also consider releases with a `pending_at` older than `now() - JOB_TIMEOUT` to be queued at the current time. This way, timed out packages are always processed after newly queued packages.