projects
/
osm
/
UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Logging page only for platform roles
[osm/UI.git]
/
skyquake
/
framework
/
core
/
api_utils
/
sockets.js
diff --git
a/skyquake/framework/core/api_utils/sockets.js
b/skyquake/framework/core/api_utils/sockets.js
index
0cd4918
..
e8ae2eb
100644
(file)
--- 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");
* 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({
var pollServer = function() {
Request({
- url: u
rl
,
+ url: u
tils.projectContextUrl(req, url)
,
method: config.method || 'GET',
headers: requestHeaders,
json: config.payload,
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) {
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);
var data = response.body;
if (self.onmessage) {
self.onmessage(data);