X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=skyquake%2Fframework%2Fcore%2Fapi_utils%2Fsockets.js;h=e8ae2ebd8dd9544935fcc90133282dfd4324d7df;hb=90aab2d191f07689f2b5249c0a8e96d2bb10acea;hp=0cd491883a5ba7b47dd41b688dc0bf588f8de62d;hpb=5a83ca0dc3306b54e1db18b9e05e860fed21324e;p=osm%2FUI.git diff --git a/skyquake/framework/core/api_utils/sockets.js b/skyquake/framework/core/api_utils/sockets.js index 0cd491883..e8ae2ebd8 100644 --- a/skyquake/framework/core/api_utils/sockets.js +++ b/skyquake/framework/core/api_utils/sockets.js @@ -1,5 +1,5 @@ /* - * + * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -284,7 +284,7 @@ function PollingSocket(url, req, interval, config) { var pollServer = function() { Request({ - url: url, + url: utils.projectContextUrl(req, url), method: config.method || 'GET', headers: requestHeaders, json: config.payload, @@ -295,7 +295,11 @@ function PollingSocket(url, req, interval, config) { console.log('Error polling: ' + url); } else { if (!self.isClosed) { - self.poll = setTimeout(pollServer, 1000 || interval); + if(process.env.DISABLE_POLLING != "TRUE") { + self.poll = setTimeout(pollServer, 1000 || interval); + } else { + console.log('Polling is disabled. Finishing request.') + } var data = response.body; if (self.onmessage) { self.onmessage(data);