bartender.web.api.job.sync#

Functions#

sync_state(→ None)

Sync state of job from scheduler to database.

update_state_and_stage_out(→ None)

Update state of job and when completed then queue the staging out of its files.

sync_states(→ None)

Sync state of jobs from scheduler to database.

_states_of_destinations(→ dict[int, ...)

_states_of_destination(→ dict[int, ...)

Module Contents#

async bartender.web.api.job.sync.sync_state(job: bartender.db.models.job_model.Job, job_dao: bartender.db.dao.job_dao.JobDAO, destination: bartender.destinations.Destination, file_staging_queue: bartender.filesystems.queue.FileStagingQueue) None#

Sync state of job from scheduler to database.

When job is completed then downloading of the output will be queued.

Parameters:
Return type:

None

async bartender.web.api.job.sync.update_state_and_stage_out(job_dao: bartender.db.dao.job_dao.JobDAO, file_staging_queue: bartender.filesystems.queue.FileStagingQueue, job: bartender.db.models.job_model.Job, state: bartender.db.models.job_model.State) None#

Update state of job and when completed then queue the staging out of its files.

Parameters:
  • job_dao (bartender.db.dao.job_dao.JobDAO) – Object to update jobs in database.

  • file_staging_queue (bartender.filesystems.queue.FileStagingQueue) – Queue used to defer downloading.

  • job (bartender.db.models.job_model.Job) – Job for which new state should be set.

  • state (bartender.db.models.job_model.State) – The new state, most likely retrieved from a scheduler.

Return type:

None

async bartender.web.api.job.sync.sync_states(jobs: list[bartender.db.models.job_model.Job], destinations: dict[str, bartender.destinations.Destination], job_dao: bartender.db.dao.job_dao.JobDAO, file_staging_queue: bartender.filesystems.queue.FileStagingQueue) None#

Sync state of jobs from scheduler to database.

Parameters:
Return type:

None

async bartender.web.api.job.sync._states_of_destinations(destinations: dict[str, bartender.destinations.Destination], jobs2sync: list[bartender.db.models.job_model.Job]) dict[int, bartender.db.models.job_model.State]#
Parameters:
Return type:

dict[int, bartender.db.models.job_model.State]

async bartender.web.api.job.sync._states_of_destination(jobs2sync: list[bartender.db.models.job_model.Job], destination_name: str, destination: bartender.destinations.Destination) dict[int, bartender.db.models.job_model.State]#
Parameters:
Return type:

dict[int, bartender.db.models.job_model.State]