Skip to content

Commit cbab1c3

Browse files
committed
test fix: dont reset progress
1 parent 52c30ee commit cbab1c3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/background_tile_loader.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ def initialize_zoom_progress
554554
existing = @route[:db][:tile_scan_progress].where(source: @source_name, zoom_level: z).first
555555

556556
if existing && ['error', 'critical_error'].include?(existing[:status])
557-
reset_zoom_progress(z)
558-
LOGGER.info("Reset #{existing[:status]} status for zoom #{z} of #{@source_name} on startup")
557+
@route[:db][:tile_scan_progress].where(source: @source_name, zoom_level: z).update(status: 'waiting')
558+
LOGGER.info("Reset #{existing[:status]} status for zoom #{z} of #{@source_name} on startup (keeping progress)")
559559
elsif existing && existing[:status] == 'source_unavailable'
560560
@route[:db][:tile_scan_progress].where(source: @source_name, zoom_level: z).update(status: 'stopped')
561561
LOGGER.info("Reset source_unavailable status (keeping coordinates) for zoom #{z} of #{@source_name} on startup")
@@ -597,6 +597,8 @@ def zoom_complete?(z)
597597
false
598598
elsif ['active', 'stopped', 'waiting'].include?(current_status)
599599
false
600+
elsif ['error', 'critical_error'].include?(current_status)
601+
false
600602
else
601603
reset_zoom_progress(z)
602604
false

0 commit comments

Comments
 (0)