retentionsvc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DailyCronSchedule = "CRON_TZ=UTC 0 0 * * *"

DailyCronSchedule is the system-owned retention maintenance cadence.

Variables

This section is empty.

Functions

func NextRunAt

func NextRunAt(now time.Time) time.Time

NextRunAt returns the next platform-owned daily retention boundary.

func PolicyFromSettings

func PolicyFromSettings(raw []byte) (model.OrganizationRetentionPolicy, error)

func ValidatePolicy

func ValidatePolicy(policy model.OrganizationRetentionPolicy) error

Types

type MaintenanceExecution

type MaintenanceExecution struct {
	SourceJobID int64
	Attempt     int
	StartedAt   time.Time
}

MaintenanceExecution identifies one private worker job attempt. SourceJobID exists only to correlate retries and is never part of tenant-safe models.

type Result

type Result struct {
	WishlistRegistrations int64
	AbuseControlBuckets   int64
	QueryExecutions       int64
	ReplayCheckpoints     int64
	PipelineRuns          int64
	Events                int64
	SkippedOrgs           []slug.Slug
}

type Service

type Service interface {
	PruneExpiredCustomerData(context.Context, MaintenanceExecution) (Result, error)
	ListMaintenanceRuns(context.Context, slug.Slug) ([]model.OrganizationRetentionRun, error)
}

func New

func New(
	txm postgres.TransactionManager,
	repo retention.Repository,
	wishlistRepo wishlistRetentionRepository,
	clk clock.Clock,
) Service

Jump to

Keyboard shortcuts

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