tasks

package
v0.0.0-...-ef84630 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPropagateConnectorVersionLabelsTask

func NewPropagateConnectorVersionLabelsTask(id apid.ID, version uint64) (*asynq.Task, error)

NewPropagateConnectorVersionLabelsTask returns an asynq task that, when processed, refreshes the materialized apxy/cxr/* carry-forward portion of every connection pointing at the given (id, version). Enqueue from the synchronous request handler after a connector version's user labels change. Only meaningful for draft connector versions; primary and active versions are immutable so the propagation is a no-op for them.

func NewPropagateNamespaceLabelsTask

func NewPropagateNamespaceLabelsTask(namespacePath string) (*asynq.Task, error)

NewPropagateNamespaceLabelsTask returns an asynq task that, when processed, walks every resource and child namespace under namespacePath and re-derives the materialized apxy/ns/* carry-forward portion of each. Enqueue this task from the synchronous request handler after a namespace's user labels are updated.

Types

type PropagateConnectorVersionLabelsPayload

type PropagateConnectorVersionLabelsPayload struct {
	ConnectorVersionId apid.ID `json:"connector_version_id"`
	Version            uint64  `json:"version"`
}

PropagateConnectorVersionLabelsPayload is the asynq task payload for taskTypePropagateConnectorVersionLabels.

type PropagateNamespaceLabelsPayload

type PropagateNamespaceLabelsPayload struct {
	NamespacePath string `json:"namespace_path"`
}

PropagateNamespaceLabelsPayload is the asynq task payload for taskTypePropagateNamespaceLabels.

type TaskRegistrar

type TaskRegistrar interface {
	RegisterTasks(mux *asynq.ServeMux)
	GetCronTasks() []*asynq.PeriodicTaskConfig
}

TaskRegistrar interface for registering tasks and providing cron configs.

func NewTaskHandler

func NewTaskHandler(
	cfg config.C,
	db database.DB,
	logger *slog.Logger,
) TaskRegistrar

NewTaskHandler creates a new task handler for database maintenance operations.

Jump to

Keyboard shortcuts

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