File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -155,18 +155,19 @@ func (g *StateSizeGenerator) initialize() chan struct{} {
155
155
LOOP:
156
156
// Wait for snapshot generator to complete first
157
157
for {
158
+ root , done := g .triedb .SnapshotCompleted ()
159
+ if done {
160
+ g .metrics .Root = root
161
+ g .buffered .Root = root
162
+ break LOOP
163
+ }
164
+
158
165
select {
159
166
case <- g .abort :
160
167
log .Info ("State size initialization aborted during snapshot wait" )
161
168
return
162
- default :
163
- root , done := g .triedb .SnapshotCompleted ()
164
- if done {
165
- g .metrics .Root = root
166
- g .buffered .Root = root
167
- break LOOP
168
- }
169
- time .Sleep (10 * time .Second )
169
+ case <- time .After (10 * time .Second ):
170
+ // Continue checking for snapshot completion
170
171
}
171
172
}
172
173
You can’t perform that action at this time.
0 commit comments