Documentation
¶
Index ¶
- Variables
- func DBNotificationThread(ctx context.Context, w Worker)
- func NewGoCronLogger() gocron.Logger
- func NewScheduler() gocron.Scheduler
- func RegisterAgent(pool db.PgxIface, provider string)
- func ScheduleProcessServices(ctx context.Context, w Worker) error
- func UpdateHeartbeat(pool db.PgxIface)
- type Coalescer
- type DebugMonitor
- func (d *DebugMonitor) IncrementJob(id uuid.UUID, name string, tags []string, status gocron.JobStatus)
- func (d *DebugMonitor) RecordJobTiming(startTime, endTime time.Time, id uuid.UUID, name string, tags []string)
- func (d *DebugMonitor) RecordJobTimingWithStatus(startTime, endTime time.Time, id uuid.UUID, name string, tags []string, ...)
- type PrometheusListener
- type PrometheusMonitor
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ErrProcessBusy = errors.New("another process run is already in progress")
ErrProcessBusy is returned by a Worker's ProcessServices/ProcessEndpoint when another run already holds the serialization lock, so the caller knows the work was skipped (not completed) and should be retried.
Functions ¶
func DBNotificationThread ¶
func NewGoCronLogger ¶
func NewScheduler ¶
func RegisterAgent ¶
func ScheduleProcessServices ¶ added in v2.5.4
ScheduleProcessServices enqueues a ProcessServices run that reschedules itself on failure or advisory-lock contention, so a busy-skipped run is re-driven promptly rather than at the next sync interval. The scheduler is taken from the Worker, so both the notification handler and PendingSyncLoop share it.
Enqueues are coalesced when the Worker provides a *Coalescer via ProcessServicesCoalescer(): a burst of signals collapses to at most one queued run, with exactly one follow-up run if a signal arrives while one is executing.
func UpdateHeartbeat ¶
UpdateHeartbeat updates the agent's heartbeat timestamp in the database. This should be called periodically to indicate the agent is still alive.
Types ¶
type Coalescer ¶ added in v2.5.4
type Coalescer struct {
// contains filtered or unexported fields
}
Coalescer collapses a burst of ProcessServices enqueue signals into at most one queued run, guaranteeing that a signal arriving while a run executes triggers exactly one follow-up run. The zero value is ready to use.
type DebugMonitor ¶
type DebugMonitor struct{}
func (*DebugMonitor) IncrementJob ¶
func (*DebugMonitor) RecordJobTiming ¶
type PrometheusListener ¶
func NewPrometheusListener ¶
func NewPrometheusListener() *PrometheusListener
func (*PrometheusListener) Run ¶
func (pl *PrometheusListener) Run()
type PrometheusMonitor ¶
type PrometheusMonitor struct {
// contains filtered or unexported fields
}
func NewPrometheusMonitor ¶
func NewPrometheusMonitor() *PrometheusMonitor