feat: add task workdir option

This commit is contained in:
engigu
2025-12-23 23:31:08 +08:00
parent ca46573c9b
commit 1d704b0e28
7 changed files with 213 additions and 7 deletions
+1
View File
@@ -19,6 +19,7 @@ type Task struct {
Command string `json:"command" gorm:"type:text;not null"`
Schedule string `json:"schedule" gorm:"size:100"` // cron expression
Timeout int `json:"timeout" gorm:"default:30"` // 超时时间(分钟),默认30分钟
WorkDir string `json:"work_dir" gorm:"size:255;default:''"` // 工作目录,为空则使用 scripts 目录
CleanConfig string `json:"clean_config" gorm:"size:255;default:''"` // 清理配置 JSON
Envs string `json:"envs" gorm:"size:255;default:''"` // 环境变量ID列表,逗号分隔
Enabled bool `json:"enabled" gorm:"default:true"`