server

package
v1.2206.0-pre1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionTypeAudit = iota + 1
	ActionTypeExecute
	ActionTypeRollback
)
View Source
const (
	SqlAuditTaskExpiredTime = 3 * 24 // 3 days
)

Variables

View Source
var (
	ErrActionExecuteOnExecutedTask       = _errors.New("task has been executed, can not do execute on it")
	ErrActionExecuteOnNonAuditedTask     = _errors.New("task has not been audited, can not do execute on it")
	ErrActionRollbackOnRollbackedTask    = _errors.New("task has been rollbacked, can not do rollback on it")
	ErrActionRollbackOnExecuteFailedTask = _errors.New("task has been executed failed, can not do rollback on it")
	ErrActionRollbackOnNonExecutedTask   = _errors.New("task has not been executed, can not do rollback on it")
)

Functions

func Audit added in v1.2202.0

func Audit(l *logrus.Entry, task *model.Task) (err error)

func ExecuteWorkflow added in v1.2112.0

func ExecuteWorkflow(workflow *model.Workflow, userId uint) error

func InitSqled

func InitSqled(exit chan struct{})

Types

type Sqled

type Sqled struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Sqled is an async task scheduling service. receive tasks from queue, the tasks include inspect, execute, rollback; and the task will only be executed once.

func GetSqled

func GetSqled() *Sqled

func (*Sqled) AddTask

func (s *Sqled) AddTask(taskId string, typ int) error

func (*Sqled) AddTaskWaitResult

func (s *Sqled) AddTaskWaitResult(taskId string, typ int) (*model.Task, error)

func (*Sqled) CleanExpiredTasks

func (s *Sqled) CleanExpiredTasks(entry *logrus.Entry)

func (*Sqled) CleanExpiredWorkflows

func (s *Sqled) CleanExpiredWorkflows(entry *logrus.Entry)

func (*Sqled) HasTask

func (s *Sqled) HasTask(taskId string) bool

func (*Sqled) Start

func (s *Sqled) Start()

func (*Sqled) WorkflowSchedule added in v1.2112.0

func (s *Sqled) WorkflowSchedule(entry *logrus.Entry)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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