Documentation
¶
Overview ¶
Package hitlworker runs the periodic sweep that finalizes pending_approval messages whose TTL has elapsed. Each row becomes either expired_approved (sent as-is) or expired_rejected based on the owning agent's hitl_expiration_action column. Body columns are scrubbed in both cases.
Index ¶
Constants ¶
const DefaultBatchSize = 100
DefaultBatchSize caps how many rows one sweep will try to finalize. The partial index on (approval_expires_at) WHERE status='pending_approval' keeps the list query cheap regardless of total table size.
const DefaultInterval = 60 * time.Second
DefaultInterval is the sweep cadence. One minute matches the design doc target; short enough that TTL boundaries are honored within a minute, long enough to avoid hot-looping the DB when there's nothing to do.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker runs the TTL sweep. Construct with New, start with Run.