Skip to content

Commit

Permalink
added submission time to trace msg endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
abdollahis2 authored and abdollahis2 committed Oct 2, 2023
1 parent be0bc94 commit 3fe6282
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tr_sys/tr_ars/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def submit(req):
logger.debug("submit")
"""Query submission"""
logger.debug("entering submit")
submission_time = timezone.now()
if req.method != 'POST':
return HttpResponse('Only POST is permitted!', status=405)

Expand All @@ -105,15 +104,15 @@ def submit(req):
if(isinstance(wf,list)):
if(len(wf)>0):
message = Message.create(code=202, status='Running', data=data,
actor=get_workflow_actor(), timestamp=submission_time)
actor=get_workflow_actor())
logger.debug("Sending message to workflow runner")#TO-DO CHANGE
# message.save()
# send_message(get_workflow_actor().to_dict(),message.to_dict())
# return HttpResponse(json.dumps(data, indent=2),
# content_type='application/json', status=201)
else:
message = Message.create(code=202, status='Running', data=data,
actor=get_default_actor(), timestamp=submission_time)
actor=get_default_actor())

if 'name' in data:
message.name = data['name']
Expand Down Expand Up @@ -216,6 +215,7 @@ def trace_message(req, key):
'message': str(mesg.id),
'status': dict(Message.STATUS)[mesg.status],
'code':mesg.code,
'timestamp': str(mesg.timestamp),
'actor': {
'pk': mesg.actor.pk,
'inforesid': mesg.actor.inforesid,
Expand Down

0 comments on commit 3fe6282

Please sign in to comment.