1676 Manager pass job_id to processor (#1680)
* Allow the processor to know the process_id Solve issue #1676 * Update base.py * Cleared blanc lines * Added set_job_id() function description * Update base.py * Update base.py --------- Co-authored-by: FrancescoIngv <FrancescoIngv@users.noreply.github.com> Co-authored-by: Tom Kralidis <tomkralidis@gmail.com>
This commit is contained in:
@@ -49,10 +49,27 @@ class BaseProcessor:
|
||||
|
||||
:returns: pygeoapi.processor.base.BaseProvider
|
||||
"""
|
||||
|
||||
self.name = processor_def['name']
|
||||
self.metadata = process_metadata
|
||||
self.supports_outputs = False
|
||||
|
||||
def set_job_id(self, job_id: str) -> None:
|
||||
"""
|
||||
Set the job_id within the processor
|
||||
To be implemented by derived classes where required.
|
||||
|
||||
:param job_id: the job_id assigned to the request by the Manager.
|
||||
The function shuold be called by the Manager upon
|
||||
assigning the job_id. The job_id is intended to be used
|
||||
by derived classes, e.g. to write temporary files where
|
||||
filenames contains the string job_id.
|
||||
|
||||
:returns: `None`
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
def execute(self, data: dict, outputs: Optional[dict] = None
|
||||
) -> Tuple[str, Any]:
|
||||
"""
|
||||
|
||||
@@ -355,6 +355,8 @@ class BaseManager:
|
||||
|
||||
job_id = str(uuid.uuid1())
|
||||
processor = self.get_processor(process_id)
|
||||
processor.set_job_id(job_id)
|
||||
|
||||
if execution_mode == RequestedProcessExecutionMode.respond_async:
|
||||
job_control_options = processor.metadata.get(
|
||||
'jobControlOptions', [])
|
||||
|
||||
Reference in New Issue
Block a user