Beispiel #1
0
    def create_direct_ingest_process_job_task(self, region: Region,
                                              ingest_args: IngestArgs):
        body = self._get_body_from_args(ingest_args)

        task_name = self._build_task_name_for_queue_and_region(
            region.get_queue_name(), region.region_code,
            ingest_args.task_id_tag())

        task = tasks.types.Task(
            name=task_name,
            app_engine_http_request={
                'relative_uri':
                f'/direct/process_job?region={region.region_code}',
                'body': json.dumps(body).encode()
            })
        self._queue_task(region.get_queue_name(), task)
Beispiel #2
0
 def _get_process_job_queue_manager(
     self, region: Region
 ) -> CloudTaskQueueManager[ProcessIngestJobCloudTaskQueueInfo]:
     if region.region_code not in self.region_process_job_queue_managers:
         self.region_process_job_queue_managers[
             region.region_code] = CloudTaskQueueManager(
                 queue_info_cls=ProcessIngestJobCloudTaskQueueInfo,
                 queue_name=region.get_queue_name(),
             )
     return self.region_process_job_queue_managers[region.region_code]
    def create_direct_ingest_process_job_task(self, region: Region,
                                              ingest_args: IngestArgs):
        task_id = _build_task_id(region.region_code,
                                 ingest_args.task_id_tag(),
                                 prefix_only=False)
        relative_uri = f'/direct/process_job?region={region.region_code}'
        body = self._get_body_from_args(ingest_args)

        self.cloud_task_client.create_task(
            task_id=task_id,
            queue_name=region.get_queue_name(),
            relative_uri=relative_uri,
            body=body,
        )
Beispiel #4
0
 def get_process_job_queue_info(self, region: Region) -> CloudTaskQueueInfo:
     return self._get_queue_info(region.get_queue_name(),
                                 region.region_code)