Browse Source

Adjusted heartbeat format (#3459)

### What problem does this PR solve?

Adjusted heartbeat format

### Type of change

- [x] Refactoring
tags/v0.14.0
Zhichang Yu 11 months ago
parent
commit
f9643adc43
No account linked to committer's email address
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      api/apps/system_app.py

+ 2
- 0
api/apps/system_app.py View File

# #
import logging import logging
from datetime import datetime from datetime import datetime
import json


from flask_login import login_required, current_user from flask_login import login_required, current_user


now = datetime.now().timestamp() now = datetime.now().timestamp()
for task_executor_id in task_executors: for task_executor_id in task_executors:
heartbeats = REDIS_CONN.zrangebyscore(task_executor_id, now - 60*30, now) heartbeats = REDIS_CONN.zrangebyscore(task_executor_id, now - 60*30, now)
heartbeats = [json.loads(heartbeat) for heartbeat in heartbeats]
task_executor_heartbeats[task_executor_id] = heartbeats task_executor_heartbeats[task_executor_id] = heartbeats
except Exception: except Exception:
logging.exception("get task executor heartbeats failed!") logging.exception("get task executor heartbeats failed!")

Loading…
Cancel
Save