X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Fcore%2Fapi_utils%2Fsockets.js;h=e8ae2ebd8dd9544935fcc90133282dfd4324d7df;hb=6fc3e77438cd4e53c5d5f21512ee8ca260469ca8;hp=2e6779c04c2593e9d13b0bca442958baffedd44f;hpb=56e55f5efc98e32a1afb3d99d07e9e5b0847a258;p=osm%2FUI.git diff --git a/skyquake/framework/core/api_utils/sockets.js b/skyquake/framework/core/api_utils/sockets.js index 2e6779c04..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"); @@ -92,6 +92,7 @@ Subscriptions.prototype.subscribe = function(req, callback) { var a = url.resolve(origin, req.baseUrl); var b = url.resolve(a, URL); URL = b; + console.log('DEBUG URL IS', URL); } else { protocol = protocol[1] } @@ -294,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);