Skip to content

Commit

Permalink
bug: makes heartbeats post return OK, get returns correct json. rucio…
Browse files Browse the repository at this point in the history
  • Loading branch information
ivukotic committed Jun 13, 2023
1 parent a86e74e commit d82e00e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/rucio/core/heartbeat.py
Expand Up @@ -217,11 +217,19 @@ def list_heartbeats(*, session: "Session"):
Heartbeats.pid,
Heartbeats.thread_name,
Heartbeats.updated_at,
Heartbeats.created_at).order_by(Heartbeats.readable,
Heartbeats.hostname,
Heartbeats.thread_name)
Heartbeats.created_at,
Heartbeats.payload).order_by(Heartbeats.readable,
Heartbeats.hostname,
Heartbeats.thread_name)

return query.all()
result = query.all()
json_result = []
for r in range(len(result)):
d = {}
for column in result[r].keys():
d[column] = getattr(result[r], column)
json_result.append(d)
return json_result


@read_session
Expand Down
1 change: 1 addition & 0 deletions lib/rucio/web/rest/flaskapi/v1/heartbeats.py
Expand Up @@ -109,6 +109,7 @@ def post(self):
return generate_http_error_flask(401, error)
except KeyNotFound as error:
return generate_http_error_flask(404, error)
return 'OK', 200


def blueprint():
Expand Down

0 comments on commit d82e00e

Please sign in to comment.