镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-07 15:06:47 +00:00
feature(worker): implemented mirror role (master/slave) option
这个提交包含在:
@@ -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 {
|
||||
|
||||
在新工单中引用
屏蔽一个用户