pi_portal.modules.tasks.processor.archive_videos.ProcessorClass

class pi_portal.modules.tasks.processor.archive_videos.ProcessorClass(log: Logger, router: TaskRouter)[source]

Bases: ArchivalTaskProcessorBaseClass

A task processor that uploads a video file to an archival service.

__init__(log: Logger, router: TaskRouter) None
archival_client_class

alias of S3BucketClient

archival_client_exception_class

alias of ArchivalException

disk_queue_class

alias of DiskQueueIterator

log_timings(processing_start_time: datetime, task: TaskBase[TypeTaskArguments_co, TypeTaskResult]) None

Log a task’s timing data with respect to it’s processing start time.

Parameters:
  • processing_start_time (datetime) – The time at which processing began.

  • task (TaskBase[TypeTaskArguments_co, TypeTaskResult]) – The task to log timing data for.

object_name(file_name: str) str[source]

Override to derive an object name from the local file name.

Parameters:

file_name (str) – The name of the file being processed.

Returns:

The S3 object name that will be used.

Return type:

str

process(task: TaskBase[TypeTaskArguments_co, TypeTaskResult]) None

Invoke the task capturing any thrown exception internally.

Parameters:

task (TaskBase[TypeTaskArguments_co, TypeTaskResult]) – The task to process.

recover(task: TaskBase[TypeTaskArguments_co, TypeTaskResult]) None

Log a message to indicate this partially failed task is recovered.

Parameters:

task (TaskBase[TypeTaskArguments_co, TypeTaskResult]) – The task to process.