Compare commits

..

No commits in common. "1f172c3b61f5d5a8cfb7f40e50914bf520bf5fd7" and "c89fba95947532f709b36f2c2f83307fc3c48564" have entirely different histories.

1 changed files with 4 additions and 11 deletions

View File

@ -38,8 +38,6 @@ def index():
@app.route("/start_run/<run_index>")
def start_run(run_index):
request_data = live_request(f'/start_run/{run_index}') #make request show up on the live requests
if not run_index.isdigit():
return f'{run_index} is not a number'
@ -55,13 +53,12 @@ def start_run(run_index):
@app.route("/link/start/<run>/<link_index>")
def link_start(run, link_index):
request_data = live_request(f'/link/start/{run}/{link_index}') #make request show up on the live requests
if not run.isdigit() or not link_index.isdigit():
return f'{run} and/or {link_index} is not a number'
start = time()
request_data = live_request(run, link_index)
sio.emit('live_request', request_data)
if db["current_run"] != run:
response = "Wrong run number, check that you update your run", 404
@ -81,8 +78,6 @@ def link_start(run, link_index):
@app.route("/link/handoff/<run>/<index>")
def link_handoff(run, index):
request_data = live_request(f'/link/handoff/{run}/{link_index}') #make request show up on the live requests
if not run.isdigit() or not index.isdigit():
return f'{run} and/or {index} is not a number'
@ -105,14 +100,12 @@ def connect(sid, data):
sio.emit('sync_current_run', current_run, room=sid)
def live_request(route_data):
def live_request(run, index):
ip = request.remote_addr
request_data = {}
request_data["hostname"] = lookup_hostname(ip)
request_data["time"] = time()
request_data["route"] = route_data
sio.emit('live_request', request_data)
return request_data
@lru_cache()