Skip to content

Commit 90cba9f

Browse files
authored
🐛 [Frontend] Log fetch response to running service (#5968)
1 parent 417e66f commit 90cba9f

File tree

2 files changed

+9
-7
lines changed
  • services/static-webserver/client/source/class/osparc

2 files changed

+9
-7
lines changed

services/static-webserver/client/source/class/osparc/data/model/Node.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,8 +1328,8 @@ qx.Class.define("osparc.data.model.Node", {
13281328
},
13291329

13301330
__waitForServiceReady: async function(srvUrl) {
1331+
this.getStatus().setInteractive("connecting");
13311332
const retry = () => {
1332-
this.getStatus().setInteractive("connecting");
13331333
// Check if node is still there
13341334
if (this.getWorkbench().getNode(this.getNodeId()) === null) {
13351335
return;
@@ -1340,7 +1340,13 @@ qx.Class.define("osparc.data.model.Node", {
13401340

13411341
// ping for some time until it is really reachable
13421342
try {
1343+
if (osparc.utils.Utils.isDevelopmentPlatform()) {
1344+
console.log("Connecting: about to fetch ", srvUrl);
1345+
}
13431346
const response = await fetch(srvUrl);
1347+
if (osparc.utils.Utils.isDevelopmentPlatform()) {
1348+
console.log("Connecting: fetch's response ", response);
1349+
}
13441350
if (response.ok || response.status === 302) {
13451351
// ok = status in the range 200-299
13461352
// some services might respond with a 302 which is also fine
@@ -1350,11 +1356,11 @@ qx.Class.define("osparc.data.model.Node", {
13501356
// we will skip those steps and directly switch its iframe
13511357
this.__serviceReadyIn(srvUrl);
13521358
} else {
1353-
console.log(`${srvUrl} is not reachable. Status: ${response.status}`);
1359+
console.log(`Connecting: ${srvUrl} is not reachable. Status: ${response.status}`);
13541360
retry();
13551361
}
13561362
} catch (error) {
1357-
console.error(`Error while checking ${srvUrl}:`, error);
1363+
console.error(`Connecting: Error while checking ${srvUrl}:`, error);
13581364
retry();
13591365
}
13601366
},

services/static-webserver/client/source/class/osparc/utils/Utils.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,6 @@ qx.Class.define("osparc.utils.Utils", {
477477
return window.location.hostname.includes("speag");
478478
},
479479

480-
isDevelEnv: function() {
481-
return window.location.hostname.includes("master.speag") || window.location.port === "9081";
482-
},
483-
484480
addBorder: function(widget, width = 1, color = "transparent") {
485481
widget.getContentElement().setStyle("border", width+"px solid " + color);
486482
},

0 commit comments

Comments
 (0)