Skip to content

Commit

Permalink
Merge pull request #1335 from yogeshojha/1152-bug-updating-tools-hang…
Browse files Browse the repository at this point in the history
…s-and-results-500-error

Fix error during tool update Fixes #1152
  • Loading branch information
yogeshojha authored Jul 30, 2024
2 parents 756b434 + f7d0a57 commit 9ca8d67
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,10 +982,14 @@ def get(self, request):
tool_name = tool_name.split('/')[-1]
update_command = 'cd /usr/src/github/' + tool_name + ' && git pull && cd -'

run_command(update_command)
run_command.apply_async(args=(update_command,))
return Response({'status': True, 'message': tool.name + ' updated successfully.'})


try:
run_command(update_command, shell=True)
run_command.apply_async(args=[update_command], kwargs={'shell': True})
return Response({'status': True, 'message': tool.name + ' updated successfully.'})
except Exception as e:
logger.error(str(e))
return Response({'status': False, 'message': str(e)})

class GetExternalToolCurrentVersion(APIView):
def get(self, request):
Expand Down

0 comments on commit 9ca8d67

Please sign in to comment.