Commit 6d58ed62 authored by Julian Rother's avatar Julian Rother
Browse files

Incorporated worker_ping into jobs_schedule endpoint

parent fa55effc
......@@ -90,12 +90,6 @@ def jobs_catch_broken():
except:
pass
@app.route('/internal/jobs/api/worker/<hostname>/ping', methods=['GET', 'POST'])
@jobs_api_token_required
def jobs_worker_ping(hostname):
query('REPLACE INTO worker (hostname, last_ping) values (?, ?)', hostname, datetime.now())
return 'OK',200
@app.route('/internal/jobs/api/job/<int:id>/ping', methods=['GET', 'POST'])
@jobs_api_token_required
def jobs_ping(id):
......@@ -117,6 +111,7 @@ def jobs_ping(id):
@app.route('/internal/jobs/api/worker/<hostname>/schedule', methods=['POST'])
@jobs_api_token_required
def jobs_schedule(hostname):
query('REPLACE INTO worker (hostname, last_ping) values (?, ?)', hostname, datetime.now())
hostdata = request.get_json()
if not hostdata:
return 'no hostdata sent', 400
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment