Skip to content

Commit

Permalink
time to solve the brown
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Erwin committed Sep 24, 2024
1 parent 60f5253 commit 587499f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions new-backend/internal/ingestor/ingestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,6 @@ func (i *Ingestor) processDataHistory(ctx context.Context) error {
return nil
}

// Redraw the full map
tiles, err := i.getLatestTileImages(ctx)
if err != nil {
return fmt.Errorf("failed to get latest tile images: %w", err)
}
utils.RenderFullMap(tiles, "cache/tilemap.png")

for _, row := range history {
location := big.NewInt(int64(row.TileID))
if err := i.renderAndSaveImage(location, row.Image, row.BlockNumber); err != nil {
Expand All @@ -627,6 +620,14 @@ func (i *Ingestor) processDataHistory(ctx context.Context) error {
return fmt.Errorf("failed to update last processed data history ID: %w", err)
}
}

// Redraw the full map
tiles, err := i.getLatestTileImages(ctx)
if err != nil {
return fmt.Errorf("failed to get latest tile images: %w", err)
}
utils.RenderFullMap(tiles, "cache/tilemap.png")

i.logger.Info("Finished processing data history", zap.Int("count", len(history)))
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions new-backend/internal/utils/render_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestRenderImage(t *testing.T) {
})

t.Run("successfully renders a PNG image from tile #2947", func(t *testing.T) {
compressedImage := "c#I@|Ph5:W*F9F%0RRS$CUB>}~UOn6r%~wJccRN7!(AY@CeGI.8$%~d|[YzYcpt/b*^LkcZ]j].JYgj7X.t+CPm>N=yzvhW|v>)6cZ0};9e0)hJ^6OI1hzzZ_z%o=9y/M@a]xTZGR%>bjV!![6?j:H7c&8M[sTSfk*8>q~FeZGHpUhB"
compressedImage := "c#I@D;=i~W/FHHllD<NjB!e<#8;&ebh)TU|@kRfb(nH7v;D*!T%wAx0z&/~BN3e87=T4rwt=3rGMP3`HWD%n:4YybsE#mk}G8$M/)NHzs:K`q[ax#29/(va@+!)`)bq~Fa#|MPS_5D"

decompressedImage, err := DecompressTileCode(compressedImage)
if err != nil {
Expand All @@ -91,6 +91,6 @@ func TestRenderImage(t *testing.T) {
}

// Clean up the test file
os.Remove("cache/test-2947.png")
// os.Remove("cache/test-2947.png")
})
}

0 comments on commit 587499f

Please sign in to comment.