Skip to content

Track importer's celery task results using ExecutionRequest model #13493

@Gpetrak

Description

@Gpetrak

We have to remove the dependency on TaskResults from django-celery-results and maintain historic task statuses directly within ExecutionRequest objects.

The tasks that have to be completed are the following:

  • Add a new field to ExecutionRequest to store task history.

  • Define a schema for the payload in ExecutionRequest to track the status of all layers and alternates, e.g.:

"tasks": {
    "alternate": {
        "geonode.upload.import_resource": "SUCCESS",
        "geonode.upload.publish_resource": "SUCCESS",
        "geonode.upload.create_geonode_resource": "FAILED"
    },
    "alternate2": {
        "geonode.upload.import_resource": "SUCCESS",
        "geonode.upload.publish_resource": "SUCCESS",
        "geonode.upload.create_geonode_resource": "SUCCESS"
    }
}
  • Analyze the Importer process and create a new base class UpdateTaskClass which overrides built-in Celery functions (on_success, on_retry) to automatically update statuses.
  • Implement logic to retrieve the alternate and task name inside these functions and update their statuses as Pending / Running / Success / Failure.
  • Align the above functionality with the evaluate_execution_progress method which updates the ExecutionRequest status
  • Test this approach using datasets with one or more layers.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions