Fixed caching issue for schedules, and removed empty key usage
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user