(self, upload_session_id: int)
Task invoked by 'upload_workflow.chord' in order to remove and cleanup all the 'INVALID' stale Upload tasks.
Task invoked by 'upload_workflow.chord' in order to remove and cleanup all the 'INVALID' stale Upload tasks.
Task invoked by upload_workflow . chord in order to remove and cleanup all the INVALID stale Upload tasks .
def _upload_session_cleanup(self, upload_session_id: int):
    """Task invoked by 'upload_workflow.chord' in order to remove and cleanup all the 'INVALID' stale Upload tasks."""
    try:
        _upload = Upload.objects.get(id=upload_session_id)
        if _upload.resource:
            resource_manager.delete(_upload.resource.uuid)
        _upload.delete()
        logger.debug(f"Upload {upload_session_id} deleted with state {_upload.state}.")
    except Exception as e:
        logger.error(f"Upload {upload_session_id} errored with exception {e}.")
def _upload_session_cleanup ( self , upload_session_id : int ) : try : _upload = Upload . objects . get ( id = upload_session_id ) if _upload . resource : resource_manager . delete ( _upload . resource . uuid ) _upload . delete ( ) logger . debug ( f"Upload {upload_session_id} deleted with state {_upload.state}." ) except Exception as e : logger . error ( f"Upload {upload_session_id} errored with exception {e}." )