镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-07 15:06:47 +00:00
feat(manager): flush disabled jobs
这个提交包含在:
@@ -70,7 +70,6 @@ func TestHTTPServer(t *testing.T) {
|
||||
So(resp.StatusCode, ShouldEqual, http.StatusOK)
|
||||
|
||||
Convey("list all workers", func(ctx C) {
|
||||
So(err, ShouldBeNil)
|
||||
resp, err := http.Get(baseURL + "/workers")
|
||||
So(err, ShouldBeNil)
|
||||
defer resp.Body.Close()
|
||||
@@ -80,6 +79,19 @@ func TestHTTPServer(t *testing.T) {
|
||||
So(len(actualResponseObj), ShouldEqual, 2)
|
||||
})
|
||||
|
||||
Convey("flush disabled jobs", func(ctx C) {
|
||||
req, err := http.NewRequest("DELETE", baseURL+"/jobs/disabled", nil)
|
||||
So(err, ShouldBeNil)
|
||||
clt := &http.Client{}
|
||||
resp, err := clt.Do(req)
|
||||
So(err, ShouldBeNil)
|
||||
defer resp.Body.Close()
|
||||
res := map[string]string{}
|
||||
err = json.NewDecoder(resp.Body).Decode(&res)
|
||||
So(err, ShouldBeNil)
|
||||
So(res[_infoKey], ShouldEqual, "flushed")
|
||||
})
|
||||
|
||||
Convey("update mirror status of a existed worker", func(ctx C) {
|
||||
status := MirrorStatus{
|
||||
Name: "arch-sync1",
|
||||
@@ -295,6 +307,10 @@ func (b *mockDBAdapter) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *mockDBAdapter) FlushDisabledJobs() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func makeMockWorkerServer(cmdChan chan WorkerCmd) *gin.Engine {
|
||||
r := gin.Default()
|
||||
r.GET("/ping", func(c *gin.Context) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户