taskLogModel

package
v0.0.0-...-fdfd418 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskLog

type TaskLog struct {
	Id             int64  `json:"id" gorm:"type:bigint(20); primary_key; auto_increment; not null"`
	TaskId         int    `json:"taskId" gorm:"type:int(20); not null; index:IDX_task_log_task_id; default 0"` // 任务id
	TaskName       string `json:"taskName" gorm:"type:varchar(100); not null"`                                 // 任务名称
	CronExpression string `json:"cronExpression" gorm:"type:varchar(100); not null"`                           // crontab
	Protocol       int8   `json:"protocol" gorm:"type:int(11); not null; index:IDX_task_log_protocol"`         // 协议 1:http 2:RPC
	Command        string `json:"command" gorm:"type:varchar(300); not null"`                                  // URL地址或shell命令
	Timeout        int    `json:"timeout" gorm:"type:int(11); not null; default 0"`                            // 任务执行超时时间(单位秒),0不限制
	RetryTimes     int8   `json:"retryTimes" gorm:"type:int(11); not null; default 0"`                         // 任务重试次数
	HostName       string `json:"hostName" gorm:"type:varchar(200); not null; default ''"`                     // RPC主机名,逗号分隔
	StartTime      string `json:"startTime" gorm:"type:varchar(50); default null"`                             // 开始执行时间
	EndTime        string `json:"endTime" gorm:"type:varchar(50); default null"`                               // 执行完成(失败)时间
	Status         int8   `json:"status" gorm:"type:int(11); not null; index:IDX_task_log_status; default 1"`  // 状态 0:执行失败 1:执行中  2:执行完毕 3:任务取消(上次任务未执行完成) 4:异步执行
	Result         string `json:"result" gorm:"type:text; not null"`                                           // 执行结果
	TotalTime      int    `json:"totalTime" gorm:"-"`                                                          // 执行总时长
}

任务执行日志

func (*TaskLog) Clear

func (taskLog *TaskLog) Clear()

清空表

func (*TaskLog) Create

func (taskLog *TaskLog) Create() int64

func (*TaskLog) List

func (taskLog *TaskLog) List(page int, pageSize int, taskName string) ([]TaskLog, int64)

func (*TaskLog) Remove

func (taskLog *TaskLog) Remove(id int)

删除N个月前的日志

func (*TaskLog) Total

func (taskLog *TaskLog) Total(params map[string]interface{}) int64

func (*TaskLog) Update

func (taskLog *TaskLog) Update(id int64, fieldMap map[string]interface{}) int64

更新

type TaskType

type TaskType int8

Jump to

Keyboard shortcuts

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