Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
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 ¶
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 ¶
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.