Skip to content

Commit

Permalink
diff: prevent writing empty expire files
Browse files Browse the repository at this point in the history
  • Loading branch information
olt committed Jul 2, 2024
1 parent 02dd673 commit be37398
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion expire/tilelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ func (tl *TileList) writeTiles(w io.Writer) error {
func (tl *TileList) Flush() error {
tl.mu.Lock()
defer tl.mu.Unlock()
if len(tl.tiles) == 0 {

foundTiles := false
for _, tiles := range tl.tiles {
if len(tiles) > 0 {
foundTiles = true
break
}
}
if !foundTiles {
return nil
}

Expand Down

0 comments on commit be37398

Please sign in to comment.