Skip to content

Commit

Permalink
Conditionally write tiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiggoha committed Jan 4, 2024
1 parent 588d442 commit 9fdb66e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion experimental/gcp-log/internal/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ func (c *Client) StoreTile(ctx context.Context, level, index uint64, tile *api.T
tPath := filepath.Join(layout.TilePath("", level, index, tileSize%256))
obj := bkt.Object(tPath)

w := obj.NewWriter(ctx)
// Tiles, partial or full, should only be written once.
w := obj.If(gcs.Conditions{DoesNotExist: true}).NewWriter(ctx)
if c.otherCacheControl != "" {
w.ObjectAttrs.CacheControl = c.otherCacheControl
}
Expand Down

0 comments on commit 9fdb66e

Please sign in to comment.