diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 5a47d81..ed92466 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -47,7 +47,7 @@ func NewLogger(cfg config.LogConfig) (*zap.Logger, error) { maxSize := applyDefaultInt(cfg.MaxSize, 100) maxBackups := applyDefaultInt(cfg.MaxBackups, 5) maxAge := applyDefaultInt(cfg.MaxAge, 30) - compress := cfg.Compress || cfg.MaxSize == 0 && cfg.MaxBackups == 0 && cfg.MaxAge == 0 + compress := cfg.Compress || (cfg.MaxSize == 0 && cfg.MaxBackups == 0 && cfg.MaxAge == 0) lj := &lumberjack.Logger{ Filename: cfg.FilePath, diff --git a/internal/model/job.go b/internal/model/job.go index f42e633..8fbe41c 100644 --- a/internal/model/job.go +++ b/internal/model/job.go @@ -2,7 +2,7 @@ package model // SubmitJobRequest is the API request for submitting a job. type SubmitJobRequest struct { - Script string `json:"script" binding:"required"` + Script string `json:"script"` Partition string `json:"partition,omitempty"` QOS string `json:"qos,omitempty"` CPUs int32 `json:"cpus,omitempty"` diff --git a/internal/model/template.go b/internal/model/template.go index 5e8d2e5..f19dfb1 100644 --- a/internal/model/template.go +++ b/internal/model/template.go @@ -22,9 +22,9 @@ func (JobTemplate) TableName() string { return "job_templates" } // CreateTemplateRequest is the API request for creating a template. type CreateTemplateRequest struct { - Name string `json:"name" binding:"required"` + Name string `json:"name"` Description string `json:"description,omitempty"` - Script string `json:"script" binding:"required"` + Script string `json:"script"` Partition string `json:"partition,omitempty"` QOS string `json:"qos,omitempty"` CPUs int `json:"cpus,omitempty"`