stuff
This commit is contained in:
parent
eec89027a4
commit
b8dfaff861
@ -206,7 +206,7 @@ var run = function(req, res, runner){
|
|||||||
|
|
||||||
return request.post(httpOptions, function(error, response, body){
|
return request.post(httpOptions, function(error, response, body){
|
||||||
// console.log('runner response:', arguments)
|
// console.log('runner response:', arguments)
|
||||||
if(response.statusCode !== 200 || error) return run(req, res, getAvailrunner());
|
if(error || response.statusCode !== 200) return run(req, res, getAvailrunner());
|
||||||
body = JSON.parse(body);
|
body = JSON.parse(body);
|
||||||
|
|
||||||
body['ip'] = getAvailrunner(runner).label;
|
body['ip'] = getAvailrunner(runner).label;
|
||||||
|
10
testAPI.py
Normal file
10
testAPI.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import requests as r
|
||||||
|
import time
|
||||||
|
|
||||||
|
def testAPI(times):
|
||||||
|
errors = 0
|
||||||
|
|
||||||
|
for i in range(times):
|
||||||
|
res = r.post('http://codeland.bytedev.co:2000/api/run', data={'code': 'pwd'})
|
||||||
|
if res.status_code != 200: errors +=1
|
||||||
|
print('errors ', errors)
|
Loading…
x
Reference in New Issue
Block a user