geonode.management_commands_http.utils.job_runner

Classes

JobRunner

With-statement context used to execute a ManagementCommandJob.

Functions

run_management_command(job_id[, async_result_id])

Loads the job model from database and run it using call_command inside a

Module Contents

class geonode.management_commands_http.utils.job_runner.JobRunner(job, stream: io.StringIO, celery_result_id: str)[source]

With-statement context used to execute a ManagementCommandJob. It handles status, start_time and end_time. And duplicates stdout and stderr to a specified file stream.

job[source]
stream[source]
celery_result_id[source]
stdout[source]
stderr[source]
write(data)[source]
flush()[source]
__enter__()[source]
__exit__(exc_type, exc_value, traceback)[source]
geonode.management_commands_http.utils.job_runner.run_management_command(job_id, async_result_id: str = '')[source]

Loads the job model from database and run it using call_command inside a context responsible to updating the status and redirecting stdout and stderr.