(self)
return jsonify(schema)
Handles GET request to the resource.

        Returns:
            A view in JSON (instance of flask.wrappers.Response)
Handles GET request to the resource.
Handles GET request to the resource .
def get(self):
        """Handles GET request to the resource.

        Returns:
            A view in JSON (instance of flask.wrappers.Response)
        """
        timeout_threshold_seconds = current_app.config.get(
            'CELERY_TASK_TIMEOUT', 7200)

        schema = {'objects': [], 'meta': {}}

        job_id = request.args.get('job_id', '')
        if job_id:
            task = self._get_celery_information(job_id)
            schema['objects'].append(task)
            return jsonify(schema)

        indices = SearchIndex.query.filter(
            SearchIndex.status.any(status='processing')).filter_by(
                user=current_user).all()
        for search_index in indices:
            if search_index.get_status.status == 'deleted':
                continue
            task = self._get_celery_information(search_index.index_name)
            task['name'] = search_index.name

            if task.get('state', '') == 'PENDING':
                time_pending = (
                    search_index.updated_at - datetime.datetime.now())
                if time_pending.seconds > timeout_threshold_seconds:
                    search_index.set_status('timeout')
            schema['objects'].append(task)
        return jsonify(schema)
def get ( self ) : timeout_threshold_seconds = current_app . config . get ( 'CELERY_TASK_TIMEOUT' , 7200 ) schema = { 'objects' : [ ] , 'meta' : { } } job_id = request . args . get ( 'job_id' , '' ) if job_id : task = self . _get_celery_information ( job_id ) schema [ 'objects' ] . append ( task ) return jsonify ( schema ) indices = SearchIndex . query . filter ( SearchIndex . status . any ( status = 'processing' ) ) . filter_by ( user = current_user ) . all ( ) for search_index in indices : if search_index . get_status . status == 'deleted' : continue task = self . _get_celery_information ( search_index . index_name ) task [ 'name' ] = search_index . name if task . get ( 'state' , '' ) == 'PENDING' : time_pending = ( search_index . updated_at - datetime . datetime . now ( ) ) if time_pending . seconds > timeout_threshold_seconds : search_index . set_status ( 'timeout' ) schema [ 'objects' ] . append ( task ) return jsonify ( schema )