fix: remove redundant binding tags and clarify logger compress logic
- Remove binding:"required" from model fields that are manually validated in handlers. - Add parentheses to logger compress default to clarify operator precedence. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -47,7 +47,7 @@ func NewLogger(cfg config.LogConfig) (*zap.Logger, error) {
|
|||||||
maxSize := applyDefaultInt(cfg.MaxSize, 100)
|
maxSize := applyDefaultInt(cfg.MaxSize, 100)
|
||||||
maxBackups := applyDefaultInt(cfg.MaxBackups, 5)
|
maxBackups := applyDefaultInt(cfg.MaxBackups, 5)
|
||||||
maxAge := applyDefaultInt(cfg.MaxAge, 30)
|
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{
|
lj := &lumberjack.Logger{
|
||||||
Filename: cfg.FilePath,
|
Filename: cfg.FilePath,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package model
|
|||||||
|
|
||||||
// SubmitJobRequest is the API request for submitting a job.
|
// SubmitJobRequest is the API request for submitting a job.
|
||||||
type SubmitJobRequest struct {
|
type SubmitJobRequest struct {
|
||||||
Script string `json:"script" binding:"required"`
|
Script string `json:"script"`
|
||||||
Partition string `json:"partition,omitempty"`
|
Partition string `json:"partition,omitempty"`
|
||||||
QOS string `json:"qos,omitempty"`
|
QOS string `json:"qos,omitempty"`
|
||||||
CPUs int32 `json:"cpus,omitempty"`
|
CPUs int32 `json:"cpus,omitempty"`
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ func (JobTemplate) TableName() string { return "job_templates" }
|
|||||||
|
|
||||||
// CreateTemplateRequest is the API request for creating a template.
|
// CreateTemplateRequest is the API request for creating a template.
|
||||||
type CreateTemplateRequest struct {
|
type CreateTemplateRequest struct {
|
||||||
Name string `json:"name" binding:"required"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
Script string `json:"script" binding:"required"`
|
Script string `json:"script"`
|
||||||
Partition string `json:"partition,omitempty"`
|
Partition string `json:"partition,omitempty"`
|
||||||
QOS string `json:"qos,omitempty"`
|
QOS string `json:"qos,omitempty"`
|
||||||
CPUs int `json:"cpus,omitempty"`
|
CPUs int `json:"cpus,omitempty"`
|
||||||
|
|||||||
Reference in New Issue
Block a user