Skip to content

Commit 2c2da5a

Browse files
author
root
committed
status api update with the writer's port as parameter
1 parent c4b3937 commit 2c2da5a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tomcat/start_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ def get_server_uptime():
142142
uptime = subprocess.run(['systemctl', 'status', 'pco_writer_1'], stdout=subprocess.PIPE).stdout.decode('utf-8').split("Active: ")[1].split(";")[0]
143143
return {'success':True, 'uptime': uptime}
144144

145-
@app.route('/status', methods=['GET'])
146-
def get_status():
145+
@app.route('/status/<endpoint>', methods=['GET'])
146+
def get_status(endpoint):
147147
"""
148148
Gets the status from the PCO writer process or from a previous
149149
execution of it.
@@ -166,7 +166,7 @@ def get_status():
166166
except Exception as e:
167167
pass
168168
# gets new status from writer
169-
request_url = app.config['endpoint']+'/status'
169+
request_url = "http://xbl-daq-34:"+endpoint+'/status'
170170
try:
171171
response = requests.get(request_url).json()
172172
if validate_response_from_writer(response):

0 commit comments

Comments
 (0)