Minor fixes for testing Singul locally
This commit is contained in:
@@ -6,7 +6,7 @@ toolchain go1.23.8
|
||||
|
||||
//replace github.com/frikky/schemaless => ../../../schemaless
|
||||
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
||||
//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared
|
||||
replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared
|
||||
|
||||
require (
|
||||
cloud.google.com/go/datastore v1.20.0
|
||||
@@ -22,7 +22,7 @@ require (
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/h2non/filetype v1.1.3
|
||||
github.com/satori/go.uuid v1.2.0
|
||||
github.com/shuffle/shuffle-shared v0.8.58
|
||||
github.com/shuffle/shuffle-shared v0.8.60
|
||||
golang.org/x/crypto v0.37.0
|
||||
google.golang.org/api v0.228.0
|
||||
google.golang.org/grpc v1.71.1
|
||||
|
||||
@@ -1905,8 +1905,8 @@ func scheduleWorkflow(resp http.ResponseWriter, request *http.Request) {
|
||||
|
||||
err = shuffle.SetSchedule(ctx, newSchedule)
|
||||
if err != nil {
|
||||
log.Printf("Failed setting cloud schedule: %s", err)
|
||||
resp.WriteHeader(401)
|
||||
log.Printf("[ERROR] Failed setting cloud schedule: %s", err)
|
||||
resp.WriteHeader(400)
|
||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, err)))
|
||||
return
|
||||
}
|
||||
@@ -1941,17 +1941,22 @@ func scheduleWorkflow(resp http.ResponseWriter, request *http.Request) {
|
||||
|
||||
// FIXME - real error message lol
|
||||
if err != nil {
|
||||
log.Printf("Failed creating schedule: %s", err)
|
||||
resp.WriteHeader(401)
|
||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Invalid argument. Try cron */15 * * * *"}`)))
|
||||
log.Printf("[ERROR] Failed creating schedule: %s", err)
|
||||
|
||||
resp.WriteHeader(400)
|
||||
if schedule.Environment == "cloud" {
|
||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Invalid argument. For cloud schedules, try cron */15 * * * *"}`)))
|
||||
} else {
|
||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Invalid argument. For onprem schedules, try 60 for 60 seconds"}`)))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//workflow.Schedules = append(workflow.Schedules, schedule)
|
||||
err = shuffle.SetWorkflow(ctx, *workflow, workflow.ID)
|
||||
if err != nil {
|
||||
log.Printf("Failed setting workflow for schedule: %s", err)
|
||||
resp.WriteHeader(401)
|
||||
log.Printf("[ERROR] Failed setting workflow for schedule: %s", err)
|
||||
resp.WriteHeader(400)
|
||||
resp.Write([]byte(`{"success": false}`))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user