timeout

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Module provides the timeout scanner and cron job registration.
	Module = fx.Module(
		"vef:approval:timeout",

		fx.Provide(NewScanner),
		fx.Invoke(registerTimeoutJobs),
	)
)

Functions

This section is empty.

Types

type Scanner

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

Scanner scans for timed-out tasks and processes them.

func NewScanner

func NewScanner(
	db orm.DB,
	bus event.Bus,
	taskSvc *service.TaskService,
	nodeSvc *service.NodeService,
	userResolver approval.UserInfoResolver,
	cfg *config.ApprovalConfig,
) *Scanner

NewScanner creates a new timeout scanner.

func (*Scanner) CleanupExpiredRecords added in v0.24.0

func (s *Scanner) CleanupExpiredRecords(ctx context.Context)

CleanupExpiredRecords prunes retention-bounded record tables: form snapshots, urge records, and read CC records. Each table has its own retention window configured via ApprovalConfig; rows older than the cutoff are deleted in a single statement.

Action logs are kept indefinitely as the canonical audit trail.

func (*Scanner) ScanPreWarnings

func (s *Scanner) ScanPreWarnings(ctx context.Context)

ScanPreWarnings finds tasks approaching their deadline and sends warning notifications in batches (same paging strategy as ScanTimeouts: processed rows flip is_pre_warning_sent, an all-failed batch stops the loop).

func (*Scanner) ScanTimeouts

func (s *Scanner) ScanTimeouts(ctx context.Context)

ScanTimeouts finds tasks that have passed their deadline and processes them in batches. The loop stops when a batch comes back short (backlog drained) or when an entire batch fails — failed rows keep is_timeout false and would be re-selected forever otherwise.

Jump to

Keyboard shortcuts

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