|
|
@@ -1,6 +1,7 @@ |
|
|
|
package cloudbrain |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
@@ -14,6 +15,10 @@ var ( |
|
|
|
TOKEN string |
|
|
|
) |
|
|
|
|
|
|
|
const ( |
|
|
|
JobHasBeenStopped = "S410" |
|
|
|
) |
|
|
|
|
|
|
|
func getRestyClient() *resty.Client { |
|
|
|
if restyClient == nil { |
|
|
|
restyClient = resty.New() |
|
|
@@ -240,7 +245,11 @@ sendjob: |
|
|
|
} |
|
|
|
|
|
|
|
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 |
|
|
|