Documentation ¶
Overview ¶
Package autobuild contains logic for scheduling workspace builds in the background.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NextAutostartSchedule ¶ added in v2.4.0
func NextAutostartSchedule(at time.Time, wsSchedule string, templateSchedule schedule.TemplateScheduleOptions) (time.Time, bool)
NextAutostartSchedule takes the workspace and template schedule and returns the next autostart schedule after "at". The boolean returned is if the autostart should be allowed to start based on the template schedule.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor automatically starts or stops workspaces.
func NewExecutor ¶
func NewExecutor(ctx context.Context, db database.Store, ps pubsub.Pubsub, tss *atomic.Pointer[schedule.TemplateScheduleStore], auditor *atomic.Pointer[audit.Auditor], acs *atomic.Pointer[dbauthz.AccessControlStore], log slog.Logger, tick <-chan time.Time) *Executor
New returns a new wsactions executor.
func (*Executor) Run ¶
func (e *Executor) Run()
Run will cause executor to start or stop workspaces on every tick from its channel. It will stop when its context is Done, or when its channel is closed.
func (*Executor) WithStatsChannel ¶
WithStatsChannel will cause Executor to push a RunStats to ch after every tick.
Click to show internal directories.
Click to hide internal directories.