Bugfixes towards blogpost 4
This commit is contained in:
@@ -455,13 +455,14 @@ func zombiecheck() error {
|
||||
continue
|
||||
}
|
||||
|
||||
if container.State != "running" {
|
||||
// Need to check time here too because a container can be removed the same instant as its created
|
||||
currenttime := time.Now().Unix()
|
||||
if container.State != "running" && currenttime-container.Created > int64(workerTimeout) {
|
||||
removeContainers = append(removeContainers, container.ID)
|
||||
containerNames[container.ID] = name
|
||||
}
|
||||
|
||||
// stopcontainer & removecontainer
|
||||
currenttime := time.Now().Unix()
|
||||
//log.Printf("Time: %d - %d", currenttime-container.Created, int64(workerTimeout))
|
||||
if container.State == "running" && currenttime-container.Created > int64(workerTimeout) {
|
||||
stopContainers = append(stopContainers, container.ID)
|
||||
|
||||
@@ -423,6 +423,11 @@ func handleExecution(client *http.Client, req *http.Request, workflowExecution W
|
||||
|
||||
onpremApps := []string{}
|
||||
startAction := workflowExecution.Start
|
||||
if len(startAction) == 0 {
|
||||
log.Printf("Didn't find execution start action. Setting it to workflow start action.")
|
||||
startAction = workflowExecution.Workflow.Start
|
||||
}
|
||||
|
||||
log.Printf("Startaction: %s", startAction)
|
||||
toExecuteOnprem := []string{}
|
||||
parents := map[string][]string{}
|
||||
@@ -660,7 +665,7 @@ func handleExecution(client *http.Client, req *http.Request, workflowExecution W
|
||||
// FIXME
|
||||
// Execute, as we don't really care if env is not set? IDK
|
||||
if action.Environment != environment { //&& action.Environment != "" {
|
||||
log.Printf("Bad environment: %s", action.Environment)
|
||||
log.Printf("Bad environment for node: %s. Want %s", action.Environment, environment)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -995,6 +1000,7 @@ func main() {
|
||||
} else {
|
||||
authorization = os.Getenv("AUTHORIZATION")
|
||||
executionId = os.Getenv("EXECUTIONID")
|
||||
log.Printf("Running normal execution with auth %s and ID %s", authorization, executionId)
|
||||
}
|
||||
|
||||
if len(authorization) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user