subjectcleanup

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 9 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 subjectcleanup coordinates restart-safe Subject expiry and teardown.

Index

Constants

View Source
const (
	StageCancelWork            = "cancel_work"
	StageDeleteSnapshots       = "delete_snapshots"
	StageStopDeleteSandboxes   = "stop_delete_sandboxes"
	StageReleaseResources      = "release_resources"
	StageRequestWorkspace      = "request_workspace_removal"
	StageAwaitAcknowledgements = "await_acknowledgements"
	StageSucceeded             = "succeeded"
	StageFailed                = "failed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionCanceller

type SessionCanceller interface {
	CancelSandboxSessions(context.Context, string, int64, string, time.Time) (int64, error)
}

SessionCanceller uses the acknowledged Runner cancellation path for active work.

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

Worker advances at most one persisted Subject cleanup stage per pass.

func NewWorker

func NewWorker(
	ctx context.Context,
	databaseURL string,
	sessions SessionCanceller,
	workerID string,
	claimDuration time.Duration,
	pollInterval time.Duration,
) (*Worker, error)

NewWorker connects the cleanup coordinator to PostgreSQL authority.

func (*Worker) Close

func (worker *Worker) Close()

func (*Worker) PollInterval

func (worker *Worker) PollInterval() time.Duration

PollInterval is the bounded restart and notification fallback cadence.

func (*Worker) RunOnce

func (worker *Worker) RunOnce(ctx context.Context, now time.Time) (bool, error)

RunOnce expires durable management records and advances one cleanup stage.

Jump to

Keyboard shortcuts

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