Skip to content

Commit

Permalink
Merge pull request #44 from sjtug/wip-restart-sync-at-start
Browse files Browse the repository at this point in the history
Restart sync at the start of lug
  • Loading branch information
htfy96 authored Mar 6, 2018
2 parents 56457e7 + 90ad167 commit bc48b55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ func NewWorker(cfg config.RepoConfig) (Worker, error) {
case "rsync":
w, err := NewRsyncWorker(
Status{
Result: true,
LastFinished: time.Now(),
Result: true,
// here we set lastFinished to a very small value to ensure immediate trigger after restart
LastFinished: time.Now().AddDate(-1, 0, 0),
Idle: true,
Stdout: make([]string, 0),
Stderr: make([]string, 0),
Expand All @@ -56,7 +57,7 @@ func NewWorker(cfg config.RepoConfig) (Worker, error) {
w, err := NewShellScriptWorker(
Status{
Result: true,
LastFinished: time.Now(),
LastFinished: time.Now().AddDate(-1, 0, 0),
Idle: true,
Stdout: make([]string, 0),
Stderr: make([]string, 0),
Expand Down

0 comments on commit bc48b55

Please sign in to comment.