Commit 901ba7f1 authored by Jalin's avatar Jalin
parents 2e89bd1d 8139eef4
# -*- coding:utf-8 -*-
import datetime import datetime
import json import json
import sys import sys
...@@ -57,8 +58,12 @@ class QueryLog(BaseLog): ...@@ -57,8 +58,12 @@ class QueryLog(BaseLog):
if not Config.is_cluster_enabled() and path.exists(self.data_path): if not Config.is_cluster_enabled() and path.exists(self.data_path):
with open(self.data_path, encoding='utf-8') as f: with open(self.data_path, encoding='utf-8') as f:
result = f.read() result = f.read()
if result: try:
result = json.loads(result) result = json.loads(result)
except json.JSONDecodeError as e:
self.add_quick_log('加载status.json失败, 文件内容为: {}.'.format(repr(result)))
self.flush()
result = {}
if Config.is_cluster_enabled(): if Config.is_cluster_enabled():
result = self.get_data_from_cluster() result = self.get_data_from_cluster()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment