Documentation
¶
Overview ¶
Package reaper periodically scans tracked operation collections for records that have been stuck in a non-terminal state (pending / running / sent / rebooting / in_progress) for longer than a configurable timeout, marks them failed, and emits a synthetic realtime event so subscribers (agents, frontends) are informed.
This directly addresses the problem that PocketBase's realtime layer is fire-and-forget: even when the original "start" event was delivered, the agent may have died mid-execution and no completion event will ever arrive. Without the reaper, the record sits in "pending" forever and the UI shows a perpetual spinner.
Configuration (environment):
STUCK_OP_TIMEOUT_SECONDS How long a record can remain in a
non-terminal state before being
reaped. Default: 3600 (1h).
STUCK_OP_SCAN_INTERVAL_SECONDS How often the reaper scans.
Default: 300 (5 min).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
Config controls the reaper's behavior. Zero values fall back to environment variables, and then to the documented defaults.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config populated from the environment or from the built-in defaults.