bartender.web.api.job.sync#
Functions#
|
Sync state of job from scheduler to database. |
|
Update state of job and when completed then queue the staging out of its files. |
|
Sync state of jobs from scheduler to database. |
|
|
|
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:
job (bartender.db.models.job_model.Job) – Job instance.
job_dao (bartender.db.dao.job_dao.JobDAO) – JobDAO object.
destination (bartender.destinations.Destination) – Job destination used to submit job.
file_staging_queue (bartender.filesystems.queue.FileStagingQueue) – When scheduler reports job is complete. The output files need to be copied back. Use queue to perform download outside request/response handling.
- 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:
jobs (list[bartender.db.models.job_model.Job]) – Job instances.
destinations (dict[str, bartender.destinations.Destination]) – Job destinations.
job_dao (bartender.db.dao.job_dao.JobDAO) – JobDAO object.
file_staging_queue (bartender.filesystems.queue.FileStagingQueue) – When scheduler reports job is complete. The output files need to be copied back. Use queue to perform download outside request/response handling.
- 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:
destinations (dict[str, bartender.destinations.Destination]) –
jobs2sync (list[bartender.db.models.job_model.Job]) –
- Return type:
- 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:
jobs2sync (list[bartender.db.models.job_model.Job]) –
destination_name (str) –
destination (bartender.destinations.Destination) –
- Return type: