From 90e8faa790a659c33f77e6a7b35672283603b6a9 Mon Sep 17 00:00:00 2001 From: shoulinwei Date: Tue, 17 Jan 2023 10:29:29 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=96=EF=B8=8F=20log=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- csst_dfs_api_cluster/common/catalog.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/csst_dfs_api_cluster/common/catalog.py b/csst_dfs_api_cluster/common/catalog.py index 0cfae24..b6fe62b 100644 --- a/csst_dfs_api_cluster/common/catalog.py +++ b/csst_dfs_api_cluster/common/catalog.py @@ -1,12 +1,9 @@ import grpc import pickle -from collections import deque import logging import io -import time from csst_dfs_commons.models import Result -from csst_dfs_commons.models.common import from_proto_model_list, Gaia3Record from csst_dfs_proto.common.ephem import ephem_pb2, ephem_pb2_grpc from .service import ServiceProxy @@ -34,7 +31,6 @@ class CatalogApi(object): try: datas = io.BytesIO() totalCount = 0 - t_start = time.time() resps = self.stub.Gaia3Search(ephem_pb2.EphemSearchRequest( ra = ra, dec = dec, @@ -47,16 +43,12 @@ class CatalogApi(object): ),metadata = get_auth_headers()) for resp in resps: if resp.success: - # data = from_proto_model_list(Gaia3Record, resp.records) datas.write(resp.records) totalCount = resp.totalCount else: return Result.error(message = str(resp.error.detail)) datas.flush() - log.info("received used: %.6f's" %(time.time() - t_start,)) - t_start = time.time() records = pickle.loads(datas.getvalue()) - log.info("unserialization used: %.6f's" %(time.time() - t_start,)) return Result.ok_data(data = records).append("totalCount", totalCount).append("columns", columns) except grpc.RpcError as e: -- GitLab