1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-06 06:26:46 +00:00

feature(worker): runMirrorJob no longer controls the interval

这个提交包含在:
bigeagle
2016-04-24 16:48:47 +08:00
父节点 afee5b2a81
当前提交 6b05a5894e
共有 3 个文件被更改,包括 32 次插入28 次删除

查看文件

@@ -9,10 +9,13 @@ import (
"time"
. "github.com/smartystreets/goconvey/convey"
. "github.com/tuna/tunasync/internal"
)
func TestMirrorJob(t *testing.T) {
InitLogger(true, true, false)
Convey("MirrorJob should work", t, func(ctx C) {
tmpDir, err := ioutil.TempDir("", "tunasync")
defer os.RemoveAll(tmpDir)
@@ -71,6 +74,7 @@ func TestMirrorJob(t *testing.T) {
loggedContent, err := ioutil.ReadFile(provider.LogFile())
So(err, ShouldBeNil)
So(string(loggedContent), ShouldEqual, exceptedOutput)
ctrlChan <- jobStart
}
select {
case <-managerChan:
@@ -107,7 +111,7 @@ echo $TUNASYNC_WORKING_DIR
go runMirrorJob(provider, ctrlChan, managerChan, semaphore)
time.Sleep(1 * time.Second)
ctrlChan <- jobStop
time.Sleep(1 * time.Second)
<-managerChan
exceptedOutput := fmt.Sprintf("%s\n", provider.WorkingDir())
loggedContent, err := ioutil.ReadFile(provider.LogFile())
So(err, ShouldBeNil)