Fixed caching issue for schedules, and removed empty key usage

This commit is contained in:
frikky
2023-03-21 16:11:05 +01:00
parent 2f2cda86b5
commit d9eaff1532
5 changed files with 14 additions and 6 deletions
+1
View File
@@ -2773,6 +2773,7 @@ class AppBase:
return True, ""
except Exception as error:
self.logger.info(f"[WARNING] Failed checking startnode: {error}")
return True, ""
available_checks = [
"=",
+1 -1
View File
@@ -19,7 +19,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/h2non/filetype v1.1.3
github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.3.62
github.com/shuffle/shuffle-shared v0.3.70
golang.org/x/crypto v0.3.0
google.golang.org/api v0.103.0
google.golang.org/appengine v1.6.7
+4 -4
View File
@@ -3560,7 +3560,7 @@ func handleCloudJob(job shuffle.CloudSyncJob) error {
} else if job.Type == "schedule" {
if job.Action == "execute" {
log.Printf("Should handle schedule for workflow %s with start node %s and data %s", job.PrimaryItemId, job.SecondaryItem, job.ThirdItem)
log.Printf("[INFO] Should handle schedule for workflow %s with start node %s and data %s", job.PrimaryItemId, job.SecondaryItem, job.ThirdItem)
err := handleCloudExecutionOnprem(job.PrimaryItemId, job.SecondaryItem, "schedule", job.ThirdItem)
if err != nil {
log.Printf("[INFO] Failed executing workflow from cloud schedule: %s", err)
@@ -3570,7 +3570,7 @@ func handleCloudJob(job shuffle.CloudSyncJob) error {
}
} else if job.Type == "email_trigger" {
if job.Action == "execute" {
log.Printf("Should handle email for workflow %s with start node %s and data %s", job.PrimaryItemId, job.SecondaryItem, job.ThirdItem)
log.Printf("[INFO] Should handle email for workflow %s with start node %s and data %s", job.PrimaryItemId, job.SecondaryItem, job.ThirdItem)
err := handleCloudExecutionOnprem(job.PrimaryItemId, job.SecondaryItem, "email_trigger", job.ThirdItem)
if err != nil {
log.Printf("Failed executing workflow from email trigger: %s", err)
@@ -3581,7 +3581,7 @@ func handleCloudJob(job shuffle.CloudSyncJob) error {
} else if job.Type == "user_input" {
if job.Action == "continue" {
log.Printf("Should handle user_input CONTINUE for workflow %s with start node %s and execution ID %s", job.PrimaryItemId, job.SecondaryItem, job.ThirdItem)
log.Printf("[INFO] Should handle user_input CONTINUE for workflow %s with start node %s and execution ID %s", job.PrimaryItemId, job.SecondaryItem, job.ThirdItem)
// FIXME: Handle authorization
ctx := context.Background()
workflowExecution, err := shuffle.GetWorkflowExecution(ctx, job.ThirdItem)
@@ -5977,7 +5977,7 @@ func initHandlers() {
r.HandleFunc("/api/v1/workflows/{key}", deleteWorkflow).Methods("DELETE", "OPTIONS")
r.HandleFunc("/api/v1/workflows/{key}", shuffle.SaveWorkflow).Methods("PUT", "OPTIONS")
r.HandleFunc("/api/v1/workflows/{key}", shuffle.GetSpecificWorkflow).Methods("GET", "OPTIONS")
r.HandleFunc("/api/v1/workflows/recommend", shuffle.RecommendAction).Methods("POST", "OPTIONS")
r.HandleFunc("/api/v1/workflows/recommend", shuffle.HandleActionRecommendation).Methods("POST", "OPTIONS")
// Triggers
r.HandleFunc("/api/v1/hooks/new", shuffle.HandleNewHook).Methods("POST", "OPTIONS")
+5 -1
View File
@@ -2664,7 +2664,11 @@ func executeSingleAction(resp http.ResponseWriter, request *http.Request) {
time.Sleep(2 * time.Second)
log.Printf("[INFO] Starting validation of execution %s", workflowExecution.ExecutionId)
returnBytes := shuffle.HandleRetValidation(ctx, workflowExecution)
returnBody := shuffle.HandleRetValidation(ctx, workflowExecution, 1)
returnBytes, err := json.Marshal(returnBody)
if err != nil {
log.Printf("[ERROR] Failed to marshal retStruct in single execution: %s", err)
}
resp.WriteHeader(200)
resp.Write(returnBytes)
+3
View File
@@ -25,6 +25,7 @@ import Introduction from "./views/Introduction";
import SetAuthentication from "./views/SetAuthentication";
import SetAuthenticationSSO from "./views/SetAuthenticationSSO";
import Search from "./views/Search.jsx";
import RunWorkflow from "./views/RunWorkflow.jsx";
import LandingPageNew from "./views/LandingpageNew";
import LoginPage from "./views/LoginPage";
@@ -540,6 +541,8 @@ const App = (message, props) => {
/>
}
/>
<Route exact path="/workflows/:key/run" element={<RunWorkflow serverside={serverside} userdata={userdata} globalUrl={globalUrl} isLoaded={isLoaded} isLoggedIn={isLoggedIn} surfaceColor={theme.palette.surfaceColor} inputColor={theme.palette.inputColor}{...props} /> } />
<Route exact path="/workflows/:key/execute" element={<RunWorkflow serverside={serverside} userdata={userdata} globalUrl={globalUrl} isLoaded={isLoaded} isLoggedIn={isLoggedIn} surfaceColor={theme.palette.surfaceColor} inputColor={theme.palette.inputColor}{...props} /> } />
<Route
exact
path="/docs/:key"