Documentation
¶
Index ¶
- type IdleStatus
- type Watchdog
- func (w *Watchdog) RebuildFromWorkers(workers []WorkerInfo)
- func (w *Watchdog) ResyncActiveTasks(ctx context.Context, db *sql.DB)
- func (w *Watchdog) Run(stopChan <-chan struct{})
- func (w *Watchdog) SetPermanent(workerID int32, isPermanent bool)
- func (w *Watchdog) TaskAccepted(workerID int32)
- func (w *Watchdog) TaskFinished(workerID int32)
- func (w *Watchdog) WorkerDeleted(workerID int32)
- func (w *Watchdog) WorkerPinged(workerID int32)
- func (w *Watchdog) WorkerRegistered(workerID int32, isPermanent bool)
- func (w *Watchdog) WorkerSpawned(workerID int32, isPermanent bool)
- type WorkerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdleStatus ¶
type IdleStatus int
const ( IdleStatusBornIdle IdleStatus = iota IdleStatusIdle IdleStatusNotIdle )
type Watchdog ¶
type Watchdog struct {
// contains filtered or unexported fields
}
func NewWatchdog ¶
func (*Watchdog) RebuildFromWorkers ¶
func (w *Watchdog) RebuildFromWorkers(workers []WorkerInfo)
func (*Watchdog) ResyncActiveTasks ¶ added in v0.7.1
ResyncActiveTasks re-queries the DB for the current active task counts and fixes up any drift caused by TaskFinished calls that arrived between the initial FetchWorkersForWatchdog query and RebuildFromWorkers.
func (*Watchdog) SetPermanent ¶ added in v0.7.4
SetPermanent updates the cached permanent flag for a worker.
func (*Watchdog) TaskAccepted ¶
Called when a worker accepts a task (Assigned ➔ Accepted)
func (*Watchdog) TaskFinished ¶
Called when a worker finishes a task (Success or Failure)
func (*Watchdog) WorkerDeleted ¶
WorkerDeleted should be called when a worker is deleted from the database
func (*Watchdog) WorkerPinged ¶
Called when a worker sends a ping
func (*Watchdog) WorkerRegistered ¶
Called when a worker is registered (comes online and is running)
func (*Watchdog) WorkerSpawned ¶
Called right after we create the DB row + cloud deploy job, before the worker is ready