diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index c5e52b09..963cfc9f 100644 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -7,6 +7,7 @@ import json import logging import requests import urllib.parse +import http.client class AppBase: __version__ = None @@ -57,17 +58,18 @@ class AppBase: # I wonder if this actually works self.logger.info("Before last stream result") url = "%s%s" % (self.base_url, stream_path) - print("[INFO] URL (URL): %s" % url) + #print("[INFO] URL (URL): %s" % url) try: ret = requests.post(url, headers=headers, json=action_result) self.logger.info("Result: %d" % ret.status_code) if ret.status_code != 200: self.logger.info(ret.text) except requests.exceptions.ConnectionError as e: - self.logger.exception("ConnectionError: %s" % e) + #self.logger.exception("ConnectionError: %s" % e) + self.logger.exception("Expected connectionerror happened") return except TypeError as e: - self.logger.exception(e) + #self.logger.exception(e) action_result["status"] = "FAILURE" action_result["result"] = "POST error: %s" % e self.logger.info("Before typeerror stream result") @@ -75,6 +77,9 @@ class AppBase: self.logger.info("Result: %d" % ret.status_code) if ret.status_code != 200: self.logger.info(ret.text) + except http.client.RemoteDisconnected as e: + self.logger.exception("Expected connectionerror happened") + return async def cartesian_product(self, L): if L: diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 1a969309..349cf5b5 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -6904,19 +6904,19 @@ func remoteOrgJobController(org Org, body []byte) error { ctx := context.Background() if !responseData.Success { - log.Printf("Should stop org job controller") + log.Printf("Should stop org job controller because no success?") - if strings.Contains(responseData.Reason, "Bad apikey") { - log.Printf("Bad apikey. Stopping sync for org?: %s", responseData.Reason) + if strings.Contains(responseData.Reason, "Bad apikey") || strings.Contains(responseData.Reason, "Error getting the organization") { + log.Printf("[WARNING] Remote error; Bad apikey or org error. Stopping sync for org: %s", responseData.Reason) if value, exists := scheduledOrgs[org.Id]; exists { // Looks like this does the trick? Hurr - log.Printf("STOPPING ORG SCHEDULE for: %s", org.Id) + log.Printf("[WARNING] STOPPING ORG SCHEDULE for: %s", org.Id) value.Lock() org, err := getOrg(ctx, org.Id) if err != nil { - log.Printf("Failed finding org %s: %s", org.Id, err) + log.Printf("[WARNING] Failed finding org %s: %s", org.Id, err) return err } @@ -6925,9 +6925,9 @@ func remoteOrgJobController(org Org, body []byte) error { org.CloudSync = false err = setOrg(ctx, *org, org.Id) if err != nil { - log.Printf("Failed setting organization when stopping sync: %s", err) + log.Printf("[WARNING] Failed setting organization when stopping sync: %s", err) } else { - log.Printf("Successfully updated the org to not sync") + log.Printf("[INFO] Successfully STOPPED org cloud sync for %s", org.Id) } return errors.New("Stopped schedule for org locally because of bad apikey.") diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index a53f403d..eeae0a0c 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -782,7 +782,7 @@ const AngularWorkflow = (props) => { return true } - const executeWorkflow = () => { + const executeWorkflow = (executionArgument, startNode) => { if (!lastSaved) { //alert.error("You might have forgotten to save before executing.") console.log("FIXME: Might have forgotten to save before executing.") @@ -804,13 +804,13 @@ const AngularWorkflow = (props) => { curelements[i].addClass("not-executing-highlight") } - if (executionText.length > 0) { - alert.success("Starting execution with an execution argument") + if (executionArgument.length > 0) { + alert.success("Starting execution WITH an execution argument") } else { alert.success("Starting execution") } - const data = {"execution_argument": executionText, "start": workflow.start} + const data = {"execution_argument": executionArgument, "start": startNode} fetch(globalUrl+"/api/v1/workflows/"+props.match.params.key+"/execute", { method: 'POST', headers: { @@ -1870,8 +1870,8 @@ const AngularWorkflow = (props) => { const paperAppStyle = { borderRadius: borderRadius, - minHeight: "100px", - maxHeight: "100px", + minHeight: 100, + maxHeight: 100, minWidth: "100%", maxWidth: "100%", marginTop: "5px", @@ -2557,7 +2557,7 @@ const AngularWorkflow = (props) => { {newAppname} - +

{newAppname}

@@ -6121,7 +6121,7 @@ const AngularWorkflow = (props) => { : @@ -6502,13 +6502,31 @@ const AngularWorkflow = (props) => { -

Executing Workflow

+
+

Executing Workflow

+ + + +
{executionData.status !== undefined && executionData.status.length > 0 ?
Status: {executionData.status}
: null } + {executionData.execution_source !== undefined && executionData.execution_source !== null && executionData.execution_source.length > 0 && executionData.execution_source !== "default" ? +
+ Source: {executionData.execution_source} +
+ : null + } {executionData.started_at !== undefined ?
Started: {new Date(executionData.started_at*1000).toISOString()} @@ -6521,12 +6539,6 @@ const AngularWorkflow = (props) => {
: null } - {executionData.execution_source !== undefined && executionData.execution_source.length > 0 ? -
- Source: {executionData.execution_source} -
- : null - } {executionData.execution_argument !== undefined && executionData.execution_argument.length > 0 ? parsedExecutionArgument() : null }