assetbucket

package
v1.167.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package assetbucket gives the asset rows written without a bucket the portal bucket (#1931).

An early release stored asset and version rows with an empty s3_bucket. Every path that reads, rewrites, copies or deletes an asset's objects takes the bucket from the row, so such an asset could not be opened, a new version of it inherited the empty bucket, and the retention purge sent its deletes to bucket "" and kept the row on every sweep. Setting the bucket on the rows mends every one of those paths at once, where resolving it at each of them would leave the next path written to fail the same way.

It is a pass rather than a migration because the bucket is the deployment's portal.s3_bucket, which a migration cannot read. It is idempotent: a row that names a bucket is never written, so a second replica, or a second boot, does no work.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, db *sql.DB, bucket string) (assets, versions int64, err error)

Run sets bucket on every asset and version row that names none, and reports how many of each it wrote. Nothing is written where bucket is empty, which is a deployment with no portal storage, where no row names an object.

func RunLogged

func RunLogged(ctx context.Context, db *sql.DB, bucket string)

RunLogged is Run for the platform's startup, which reports what it did and goes on: an asset left without a bucket is no reason to refuse to serve the rest.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL