Skip to content

Commit

Permalink
feat: 快速下载-计算平台暂不支持快速下载提示 #1010158081121769650
Browse files Browse the repository at this point in the history
  • Loading branch information
wencong1724427771 committed Jan 23, 2025
1 parent 0119010 commit 172c571
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bklog/apps/log_search/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ class PreCheckAsyncExportException(BaseException):
MESSAGE = _("创建异步导出任务前置检查失败,请检查索引集字段配置")


class BKBaseExportException(BaseException):
ERROR_CODE = "505"
MESSAGE = _("计算平台暂不支持快速下载")


# =================================================
# JWT
# =================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
IndexSetType,
)
from apps.log_search.exceptions import (
BKBaseExportException,
MissAsyncExportException,
PreCheckAsyncExportException,
)
from apps.log_search.handlers.search.search_handlers_esquery import SearchHandler
from apps.log_search.models import AsyncTask, LogIndexSet
from apps.log_search.models import AsyncTask, LogIndexSet, Scenario
from apps.log_search.tasks.async_export import async_export
from apps.models import model_to_dict
from apps.utils.db import array_chunk
Expand Down Expand Up @@ -84,6 +85,9 @@ def __init__(
self.export_file_type = export_file_type

def async_export(self, is_quick_export: bool = False):
# 计算平台暂不支持快速下载
if is_quick_export and self.search_handler.scenario_id == Scenario.BKDATA:
raise BKBaseExportException()
# 判断fields是否支持
fields = self._pre_check_fields()
# 获取排序字段
Expand Down

0 comments on commit 172c571

Please sign in to comment.