Documentation
¶
Index ¶
- func EvictWorker(ctx context.Context, srv *server.Server, workerID, reason string)
- func GracefulShutdown(ctx context.Context, srv *server.Server)
- func PurgeApp(srv *server.Server, app *db.AppRow)
- func SpawnHealthPoller(ctx context.Context, srv *server.Server)
- func SpawnLogCapture(ctx context.Context, srv *server.Server, workerID, appID string)
- func SpawnLogRetentionCleaner(ctx context.Context, srv *server.Server)
- func SpawnSoftDeleteSweeper(ctx context.Context, srv *server.Server)
- func StartupCleanup(ctx context.Context, srv *server.Server, passive bool) error
- func StopAppSync(srv *server.Server, appID string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvictWorker ¶
EvictWorker is the single codepath for decommissioning a worker. Idempotent — safe to call concurrently from multiple goroutines. reason is recorded in the blockyard_workers_stopped_total metric and must be one of the telemetry.Reason* constants.
func GracefulShutdown ¶
GracefulShutdown stops all workers, removes managed resources, and fails in-progress builds. Called after HTTP server drain and background goroutine cancellation.
func PurgeApp ¶ added in v0.0.3
PurgeApp permanently removes an app's bundles, files, and database rows. The app must already have no running workers. Used by both the DeleteApp handler (immediate delete) and the sweeper.
func SpawnHealthPoller ¶
SpawnHealthPoller runs health checks at config.Proxy.HealthInterval. Blocks until ctx is cancelled.
func SpawnLogCapture ¶
SpawnLogCapture starts a goroutine that streams logs from the backend into the LogStore for the given worker.
func SpawnLogRetentionCleaner ¶
SpawnLogRetentionCleaner periodically prunes expired log entries. Blocks until ctx is cancelled.
func SpawnSoftDeleteSweeper ¶ added in v0.0.3
SpawnSoftDeleteSweeper periodically purges soft-deleted apps whose retention period has expired. Blocks until ctx is cancelled. Does not start if soft_delete_retention is zero (soft-delete disabled — nothing to sweep).
func StartupCleanup ¶
StartupCleanup removes orphaned resources and fails stale builds. Called in main() before binding the listener. When passive is true (rolling update), destructive operations that would kill workers the old server is handing off are skipped.
func StopAppSync ¶ added in v0.0.3
StopAppSync stops all workers for an app synchronously. Marks workers as draining, waits for sessions to end (up to shutdown_timeout), then force-evicts. If no workers are running, this is a no-op.
Types ¶
This section is empty.