| @@ -1,6 +1,7 @@ | |||||
| package cloudbrain | package cloudbrain | ||||
| import ( | import ( | ||||
| "code.gitea.io/gitea/modules/log" | |||||
| "fmt" | "fmt" | ||||
| "code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
| @@ -14,6 +15,10 @@ var ( | |||||
| TOKEN string | TOKEN string | ||||
| ) | ) | ||||
| const ( | |||||
| JobHasBeenStopped = "S410" | |||||
| ) | |||||
| func getRestyClient() *resty.Client { | func getRestyClient() *resty.Client { | ||||
| if restyClient == nil { | if restyClient == nil { | ||||
| restyClient = resty.New() | restyClient = resty.New() | ||||
| @@ -240,7 +245,11 @@ sendjob: | |||||
| } | } | ||||
| if result.Code != Success { | if result.Code != Success { | ||||
| return fmt.Errorf("StopJob err: %s", res.String()) | |||||
| if result.Code == JobHasBeenStopped { | |||||
| log.Info("StopJob(%s) failed:%s", jobID, result.Msg) | |||||
| } else { | |||||
| return fmt.Errorf("StopJob err: %s", res.String()) | |||||
| } | |||||
| } | } | ||||
| return nil | return nil | ||||