From 4d57b37a5dbd4fac45fdb9eedd3118b217cf4538 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sat, 13 Dec 2025 13:06:22 +0100 Subject: [PATCH] Remove verbose _mb suffix --- README.md | 2 +- docs/configuration.md | 4 ++-- pkg/config/config.go | 10 +++++----- pkg/instance/instance.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9f9135d..795317b 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ instances: on_demand_start_timeout: 120 # Default on-demand start timeout in seconds timeout_check_interval: 5 # Idle instance timeout check in minutes log_rotation_enabled: true # Enable log rotation (default: true) - log_rotation_max_size_mb: 100 # Max log file size in MB before rotation (default: 100) + log_rotation_max_size: 100 # Max log file size in MB before rotation (default: 100) log_rotation_compress: false # Compress rotated log files (default: false) database: diff --git a/docs/configuration.md b/docs/configuration.md index 38e741d..5254b4e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -231,7 +231,7 @@ instances: on_demand_start_timeout: 120 # Default on-demand start timeout in seconds timeout_check_interval: 5 # Default instance timeout check interval in minutes log_rotation_enabled: true # Enable log rotation (default: true) - log_rotation_max_size_mb: 100 # Max log file size in MB before rotation (default: 100) + log_rotation_max_size: 100 # Max log file size in MB before rotation (default: 100) log_rotation_compress: false # Compress rotated log files (default: false) ``` @@ -250,7 +250,7 @@ instances: - `LLAMACTL_ON_DEMAND_START_TIMEOUT` - Default on-demand start timeout in seconds - `LLAMACTL_TIMEOUT_CHECK_INTERVAL` - Default instance timeout check interval in minutes - `LLAMACTL_LOG_ROTATION_ENABLED` - Enable log rotation (true/false) -- `LLAMACTL_LOG_ROTATION_MAX_SIZE_MB` - Max log file size in MB +- `LLAMACTL_LOG_ROTATION_MAX_SIZE` - Max log file size in MB - `LLAMACTL_LOG_ROTATION_COMPRESS` - Compress rotated logs (true/false) ### Database Configuration diff --git a/pkg/config/config.go b/pkg/config/config.go index c1a94de..869ac67 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -133,7 +133,7 @@ type InstancesConfig struct { LogRotationEnabled bool `yaml:"log_rotation_enabled" default:"true"` // Maximum log file size in MB before rotation - LogRotationMaxSizeMB int `yaml:"log_rotation_max_size_mb" default:"100"` + LogRotationMaxSize int `yaml:"log_rotation_max_size" default:"100"` // Whether to compress rotated log files LogRotationCompress bool `yaml:"log_rotation_compress" default:"false"` @@ -229,7 +229,7 @@ func LoadConfig(configPath string) (AppConfig, error) { TimeoutCheckInterval: 5, // Check timeouts every 5 minutes LogsDir: "", // Will be set to data_dir/logs if empty LogRotationEnabled: true, - LogRotationMaxSizeMB: 100, + LogRotationMaxSize: 100, LogRotationCompress: false, }, Database: DatabaseConfig{ @@ -568,9 +568,9 @@ func loadEnvVars(cfg *AppConfig) { cfg.Instances.LogRotationEnabled = b } } - if logRotationMaxSizeMB := os.Getenv("LLAMACTL_LOG_ROTATION_MAX_SIZE_MB"); logRotationMaxSizeMB != "" { - if m, err := strconv.Atoi(logRotationMaxSizeMB); err == nil { - cfg.Instances.LogRotationMaxSizeMB = m + if logRotationMaxSize := os.Getenv("LLAMACTL_LOG_ROTATION_MAX_SIZE"); logRotationMaxSize != "" { + if m, err := strconv.Atoi(logRotationMaxSize); err == nil { + cfg.Instances.LogRotationMaxSize = m } } if logRotationCompress := os.Getenv("LLAMACTL_LOG_ROTATION_COMPRESS"); logRotationCompress != "" { diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 6a26d79..5df5111 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -71,7 +71,7 @@ func New(name string, globalConfig *config.AppConfig, opts *Options, onStatusCha if !instance.IsRemote() { logRotationConfig := &LogRotationConfig{ Enabled: globalInstanceSettings.LogRotationEnabled, - MaxSizeMB: globalInstanceSettings.LogRotationMaxSizeMB, + MaxSizeMB: globalInstanceSettings.LogRotationMaxSize, Compress: globalInstanceSettings.LogRotationCompress, } instance.logger = newLogger(