if noone is working pick the last worker in sync wait
This commit is contained in:
parent
5dcf339840
commit
d6e2c80608
@ -273,7 +273,7 @@ func SyncWait(ctx context.Context, napi api.FullNode, watch bool) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
working := 0
|
working := -1
|
||||||
for i, ss := range state.ActiveSyncs {
|
for i, ss := range state.ActiveSyncs {
|
||||||
switch ss.Stage {
|
switch ss.Stage {
|
||||||
case api.StageSyncComplete:
|
case api.StageSyncComplete:
|
||||||
@ -284,6 +284,10 @@ func SyncWait(ctx context.Context, napi api.FullNode, watch bool) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if working == -1 {
|
||||||
|
working = len(state.ActiveSyncs) - 1
|
||||||
|
}
|
||||||
|
|
||||||
ss := state.ActiveSyncs[working]
|
ss := state.ActiveSyncs[working]
|
||||||
workerID := ss.WorkerID
|
workerID := ss.WorkerID
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user