Commit 26fa0b7a authored by Indrek Jentson's avatar Indrek Jentson

Runtime-check teenusele lisatud serveri ühenduse kontroll, timeout fix

Signed-off-by: Indrek Jentson's avatarIndrek Jentson <indrek.jentson@ut.ee>
parent e01231d9
......@@ -77,7 +77,7 @@ var CheckService = function(){
this.checkServer = function() {
return new Promise( function(resolve, reject) {
try {
request.get(config.serverUrl + ':3000', function(err, replay) {
request.get({url: config.serverUrl + ':3000', timeout: 5000}, function(err, replay) {
if (err) resolve({type:'ERR', msg: 'ühendus serveriga ' + config.serverUrl + ' ei tööta: ' + err});
else {
resolve({type:'OK', msg: 'ühendus serveriga ' + config.serverUrl + ' töötab'});
......
Markdown is supported
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