Dev (#2036)
* fix(chalice): fixed vault with exp_search * refactor(chalice): enhanced CH exception handler
This commit is contained in:
parent
897ea18f57
commit
7d82b4a04c
2 changed files with 6 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ import logging
|
|||
from typing import List, Union
|
||||
|
||||
import schemas
|
||||
from chalicelib.core import events, metadata, projects, performance_event, metrics, sessions_legacy
|
||||
from chalicelib.core import events, metadata, projects, performance_event, metrics, sessions_favorite, sessions_legacy
|
||||
from chalicelib.utils import pg_client, helper, metrics_helper, ch_client, exp_ch_helper
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -110,6 +110,8 @@ def _isUndefined_operator(op: schemas.SearchEventOperator):
|
|||
def search_sessions(data: schemas.SessionsSearchPayloadSchema, project_id, user_id, errors_only=False,
|
||||
error_status=schemas.ErrorStatus.all, count_only=False, issue=None, ids_only=False,
|
||||
platform="web"):
|
||||
if data.bookmarked:
|
||||
data.startTimestamp, data.endTimestamp = sessions_favorite.get_start_end_timestamp(project_id, user_id)
|
||||
full_args, query_part = search_query_parts_ch(data=data, error_status=error_status, errors_only=errors_only,
|
||||
favorite_only=data.bookmarked, issue=issue, project_id=project_id,
|
||||
user_id=user_id, platform=platform)
|
||||
|
|
|
|||
|
|
@ -41,8 +41,10 @@ class ClickHouseClient:
|
|||
keys = tuple(x for x, y in results[1])
|
||||
return [dict(zip(keys, i)) for i in results[0]]
|
||||
except Exception as err:
|
||||
logging.error("--------- CH EXCEPTION -----------")
|
||||
logging.error(err)
|
||||
logging.error("--------- CH QUERY EXCEPTION -----------")
|
||||
logging.error(self.format(query=query, params=params))
|
||||
logging.error(self.format(query=query, params=params).replace('\n','\\n'))
|
||||
logging.error("--------------------")
|
||||
raise err
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue