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

feature(worker): implemented mirror role (master/slave) option

这个提交包含在:
bigeagle
2016-04-29 22:38:47 +08:00
父节点 8399417880
当前提交 56459f2ce0
共有 4 个文件被更改,包括 22 次插入1 次删除

查看文件

@@ -44,6 +44,7 @@ type mirrorProvider interface {
WorkingDir() string
LogDir() string
LogFile() string
IsMaster() bool
// enter context
EnterContext() *Context
@@ -59,6 +60,7 @@ type baseProvider struct {
ctx *Context
name string
interval time.Duration
isMaster bool
cmd *cmdJob
isRunning atomic.Value
@@ -92,6 +94,10 @@ func (p *baseProvider) Interval() time.Duration {
return p.interval
}
func (p *baseProvider) IsMaster() bool {
return p.isMaster
}
func (p *baseProvider) WorkingDir() string {
if v, ok := p.ctx.Get(_WorkingDirKey); ok {
if s, ok := v.(string); ok {