File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -601,12 +601,11 @@ func (s *RoSnapshots) VisibleBlocksAvailable(t snaptype.Enum) uint64 {
601
601
}
602
602
603
603
func (s * RoSnapshots ) DownloadComplete () {
604
- if ! s .SegmentsReady () {
605
- return
606
- }
607
604
wasReady := s .downloadReady .Swap (true )
608
605
if ! wasReady {
609
- s .ready .set ()
606
+ if s .SegmentsReady () {
607
+ s .ready .set ()
608
+ }
610
609
}
611
610
}
612
611
@@ -987,7 +986,12 @@ func (s *RoSnapshots) InitSegments(fileNames []string) error {
987
986
}
988
987
989
988
s .recalcVisibleFiles ()
990
- s .segmentsReady .Store (true )
989
+ wasReady := s .segmentsReady .Swap (true )
990
+ if ! wasReady {
991
+ if s .downloadReady .Load () {
992
+ s .ready .set ()
993
+ }
994
+ }
991
995
992
996
return nil
993
997
}
@@ -1152,7 +1156,12 @@ func (s *RoSnapshots) OpenFolder() error {
1152
1156
}
1153
1157
1154
1158
s .recalcVisibleFiles ()
1155
- s .segmentsReady .Store (true )
1159
+ wasReady := s .segmentsReady .Swap (true )
1160
+ if ! wasReady {
1161
+ if s .downloadReady .Load () {
1162
+ s .ready .set ()
1163
+ }
1164
+ }
1156
1165
return nil
1157
1166
}
1158
1167
You can’t perform that action at this time.
0 commit comments