Skip to content

Commit be37398

Browse files
committedJul 2, 2024
diff: prevent writing empty expire files
1 parent 02dd673 commit be37398

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎expire/tilelist.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,15 @@ func (tl *TileList) writeTiles(w io.Writer) error {
162162
func (tl *TileList) Flush() error {
163163
tl.mu.Lock()
164164
defer tl.mu.Unlock()
165-
if len(tl.tiles) == 0 {
165+
166+
foundTiles := false
167+
for _, tiles := range tl.tiles {
168+
if len(tiles) > 0 {
169+
foundTiles = true
170+
break
171+
}
172+
}
173+
if !foundTiles {
166174
return nil
167175
}
168176

0 commit comments

Comments
 (0)