This commit is contained in:
William Mantly 2016-05-30 17:27:21 -04:00
parent eec89027a4
commit b8dfaff861
2 changed files with 11 additions and 1 deletions

View File

@ -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
View 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)