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 Apr 13, 2023
1 parent a86e74e commit 524c6d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions lib/rucio/core/heartbeat.py
Expand Up @@ -217,12 +217,19 @@ def list_heartbeats(*, session: "Session"):
Heartbeats.pid,
Heartbeats.thread_name,
Heartbeats.updated_at,
Heartbeats.created_at).order_by(Heartbeats.readable,
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
def list_payload_counts(executable, older_than=600, hash_executable=None, *, session: "Session"):
Expand Down
2 changes: 1 addition & 1 deletion lib/rucio/web/rest/flaskapi/v1/heartbeats.py
Expand Up @@ -109,7 +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():
bp = AuthenticatedBlueprint('heartbeats', __name__, url_prefix='/heartbeats')
Expand Down

0 comments on commit 524c6d6

Please sign in to comment.