Skip to content

Commit

Permalink
fix: 修复获取binlog错误 TencentBlueKing#6867
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo committed Sep 11, 2024
1 parent e1292da commit ec663a3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def get_backup_binlog(
cluster_id: int, start_time: datetime, end_time: datetime, binlog_info: dict, minute_range=30
cluster_id: int, start_time: datetime, end_time: datetime, binlog_info: dict, minute_range=30
) -> dict:
result = {}
if start_time > end_time:
Expand All @@ -28,7 +28,7 @@ def get_backup_binlog(
# 先从别分文件的主节点查询,查询不到改为从节点查询。
rollback_handler = FixPointRollbackHandler(cluster_id)
backup_binlog = None
if "show_slave_status" in binlog_info.keys():
if "show_slave_status" in binlog_info.keys() and binlog_info.get("show_slave_status", {}) is not None:
backup_binlog = rollback_handler.query_binlog_from_bklog(
start_time=start_time,
end_time=end_time,
Expand Down

0 comments on commit ec663a3

Please sign in to comment.