Skip to content

Commit 2622559

Browse files
committed
fix: new repos were treated as failed
1 parent f6671c3 commit 2622559

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pkg/manager/manager.go

+10-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type Status struct {
5353
type WorkerCheckPoint struct {
5454
LastInvokeTime time.Time `json:"last_invoke_time"`
5555
LastFinished *time.Time `json:"last_finished,omitempty"`
56-
Result bool `json:"result,omitempty"`
56+
Result *bool `json:"result,omitempty"`
5757
}
5858

5959
type CheckPoint struct {
@@ -92,10 +92,15 @@ func workerFromCheckpoint(repoConfig config.RepoConfig, checkpoint *CheckPoint,
9292
return worker.NewWorker(repoConfig, lastInvokeTime, true)
9393
}
9494

95-
if info.LastFinished == nil {
96-
return worker.NewWorker(repoConfig, lastInvokeTime, info.Result)
95+
result := true
96+
if info.Result != nil {
97+
result = *info.Result
9798
}
98-
return worker.NewWorker(repoConfig, *info.LastFinished, info.Result)
99+
lastFinished := lastInvokeTime
100+
if info.LastFinished != nil {
101+
lastFinished = *info.LastFinished
102+
}
103+
return worker.NewWorker(repoConfig, lastFinished, result)
99104
}
100105

101106
// NewManager creates a new manager with attached workers from config
@@ -148,7 +153,7 @@ func (m *Manager) checkpoint() error {
148153

149154
ckptObj.WorkerInfo[name] = WorkerCheckPoint{
150155
LastInvokeTime: lastInvokeTime,
151-
Result: status.Result,
156+
Result: &status.Result,
152157
LastFinished: &status.LastFinished,
153158
}
154159
}

0 commit comments

Comments
 (0)