@@ -5016,6 +5016,9 @@ func HandleGetTriggers(resp http.ResponseWriter, request *http.Request) {
50165016}
50175017
50185018func GetGcpSchedule(ctx context.Context, id string) (*ScheduleOld, error) {
5019+ if project.Environment != "cloud" {
5020+ return &ScheduleOld{}, nil
5021+ }
50195022
50205023 // Check if we have the schedule in cache
50215024 cacheData, err := GetCache(ctx, fmt.Sprintf("schedule-%s", id))
@@ -5055,9 +5058,13 @@ func GetGcpSchedule(ctx context.Context, id string) (*ScheduleOld, error) {
50555058 }
50565059 resp, err := c.GetJob(ctx, req)
50575060 if err != nil {
5058- log.Printf("[ERROR] Failed getting schedule %s: %s", id, err)
5061+ if !strings.Contains(err.Error(), "NotFound") {
5062+ log.Printf("[ERROR] Failed getting schedule %s: %s", id, err)
5063+ }
5064+
50595065 return schedule, err
50605066 }
5067+
50615068 schedule.Id = id
50625069 schedule.Name = resp.Name
50635070 if resp.State == schedulerpb.Job_ENABLED {
@@ -10587,7 +10594,7 @@ func GetSpecificWorkflow(resp http.ResponseWriter, request *http.Request) {
1058710594 }
1058810595
1058910596 //Check if workflow trigger schedule is in sync with the gcp cron job
10590- if workflow.Triggers != nil {
10597+ if project.Environment == "cloud" && workflow.Triggers != nil {
1059110598 var wg sync.WaitGroup
1059210599 triggerMutex := sync.Mutex{}
1059310600
@@ -23299,7 +23306,7 @@ func HealthCheckHandler(resp http.ResponseWriter, request *http.Request) {
2329923306// 2. Parent workflow's owner is same org?
2330023307// 3. Parent execution auth is correct
2330123308func RunExecuteAccessValidation(request *http.Request, workflow *Workflow) (bool, string) {
23302- log.Printf("[DEBUG] Inside execute validation for workflow %s (%s)! Request method: %s", workflow.Name, workflow.ID, request.Method)
23309+ // log.Printf("[DEBUG] Inside execute validation for workflow %s (%s)! Request method: %s", workflow.Name, workflow.ID, request.Method)
2330323310
2330423311 //if request.Method == "POST" {
2330523312 ctx := GetContext(request)
@@ -30585,6 +30592,7 @@ func checkExecutionStatus(ctx context.Context, exec *WorkflowExecution) *Workflo
3058530592 */
3058630593 }
3058730594
30595+ exec.Workflow.Validation.NotificationsCreated = exec.NotificationsCreated
3058830596 exec.Workflow.Validation = workflow.Validation
3058930597 marshalledValidation, err := json.Marshal(workflow.Validation)
3059030598 if err != nil {
@@ -30597,7 +30605,6 @@ func checkExecutionStatus(ctx context.Context, exec *WorkflowExecution) *Workflo
3059730605 SetCache(backgroundContext, cacheKey, marshalledValidation, 120)
3059830606
3059930607 // ALWAYS have correct exec id for current execution, but not always in workflow
30600-
3060130608 //log.Printf("\n\n[DEBUG][%s] Set workflow validation (%d) to '%s'\n\n", exec.ExecutionId, len(workflow.Validation.Errors), marshalledValidation)
3060230609
3060330610 return exec
0 commit comments