bgtasks

package
v0.0.51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitBgTasks

func InitBgTasks(
	redisHost string,
	redisPort int,
	concurrency uint,
	codeboxInstanceId string,
) error

Initialize bg tasks system, register all the tasks and start the worker pool

func RemoveWorkspace added in v0.0.51

func RemoveWorkspace(workspace models.Workspace, skipErrors bool) error

Function that removes a workspace and all its associated data It's a separate function so it can be called from multiple places

func StopWorkspace added in v0.0.47

func StopWorkspace(workspace *models.Workspace, skipErrors bool) error

Stop a running workspace, this is a separate function so it can be called from multiple places

Types

type Context

type Context struct {
	WorkspaceID uint
}

func (*Context) DeleteRunnerTask added in v0.0.47

func (jobContext *Context) DeleteRunnerTask(job *work.Job) error

Delete a runner: - stop all workspaces running on this runner (ignoring errors) - set workspace runner as nil - delete the runner

func (*Context) DeleteUserTask added in v0.0.47

func (jobContext *Context) DeleteUserTask(job *work.Job) error

Background task that deletes a user, this task deletes the user and all his workspaces

func (*Context) DeleteWorkspaceTask added in v0.0.47

func (jobContext *Context) DeleteWorkspaceTask(job *work.Job) error

Background task that deletes a workspace, this task deletes the workspace and all its associated data

func (*Context) PingAgentsTask added in v0.0.47

func (jobContext *Context) PingAgentsTask(job *work.Job) error

Ping all workspaces agents to check if they are online

func (*Context) PingRunnersTask added in v0.0.47

func (jobContext *Context) PingRunnersTask(job *work.Job) error

Ping all runners to check if they are online and get their version

func (*Context) StartWorkspaceTask added in v0.0.47

func (jobContext *Context) StartWorkspaceTask(job *work.Job) error

func (*Context) StopWorkspaceTask added in v0.0.47

func (jobContext *Context) StopWorkspaceTask(job *work.Job) error

Stop a running workspace, this is the background task

func (*Context) UpdateWorkspaceConfigFilesTask added in v0.0.47

func (jobContext *Context) UpdateWorkspaceConfigFilesTask(job *work.Job) error

Update workspace configuration files, this task fetches the latest configuration files from the git repository or updates the template version if the config source is template then restarts the workspace

type EnqueuerInterface added in v0.0.47

type EnqueuerInterface interface {
	Enqueue(jobName string, args map[string]interface{}) (*work.Job, error)
}
var (
	BgTasksEnqueuer EnqueuerInterface
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL