Skip to content

Commit

Permalink
Apply the changes in command API
Browse files Browse the repository at this point in the history
  • Loading branch information
eunyoung14 committed Apr 8, 2024
1 parent bbf8272 commit 4e9ec89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion alpamon/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '1.1.7'
VERSION = '1.1.8'
5 changes: 2 additions & 3 deletions alpamon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ def on_message(self, message):
# command request handler
elif content['query'] == 'command':
command = content['command']
self.api_session.patch(
'/api/events/commands/%(id)s/' % command,
json={'acked_at': now()},
self.api_session.post(
'/api/events/commands/%(id)s/ack/' % command,
priority=10,
buffered=True,
)
Expand Down
5 changes: 2 additions & 3 deletions alpamon/runner/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,11 @@ def run(self):

t_end = time.time()
if result != None and self.command.get('id', None) != None:
self.client.api_session.patch(
'/api/events/commands/%(id)s/' % self.command, json={
self.client.api_session.post(
'/api/events/commands/%(id)s/fin/' % self.command, json={
'success': exitcode == 0,
'result': result,
'elapsed_time': (t_end-t_start),
'handled_at': now(),
},
priority=10,
buffered=True,
Expand Down

0 comments on commit 4e9ec89

Please sign in to comment.