Remove verbose _mb suffix

This commit is contained in:
2025-12-13 13:06:22 +01:00
parent c13b71d07f
commit 4d57b37a5d
4 changed files with 9 additions and 9 deletions

View File

@@ -196,7 +196,7 @@ instances:
on_demand_start_timeout: 120 # Default on-demand start timeout in seconds on_demand_start_timeout: 120 # Default on-demand start timeout in seconds
timeout_check_interval: 5 # Idle instance timeout check in minutes timeout_check_interval: 5 # Idle instance timeout check in minutes
log_rotation_enabled: true # Enable log rotation (default: true) 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) log_rotation_compress: false # Compress rotated log files (default: false)
database: database:

View File

@@ -231,7 +231,7 @@ instances:
on_demand_start_timeout: 120 # Default on-demand start timeout in seconds on_demand_start_timeout: 120 # Default on-demand start timeout in seconds
timeout_check_interval: 5 # Default instance timeout check interval in minutes timeout_check_interval: 5 # Default instance timeout check interval in minutes
log_rotation_enabled: true # Enable log rotation (default: true) 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) 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_ON_DEMAND_START_TIMEOUT` - Default on-demand start timeout in seconds
- `LLAMACTL_TIMEOUT_CHECK_INTERVAL` - Default instance timeout check interval in minutes - `LLAMACTL_TIMEOUT_CHECK_INTERVAL` - Default instance timeout check interval in minutes
- `LLAMACTL_LOG_ROTATION_ENABLED` - Enable log rotation (true/false) - `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) - `LLAMACTL_LOG_ROTATION_COMPRESS` - Compress rotated logs (true/false)
### Database Configuration ### Database Configuration

View File

@@ -133,7 +133,7 @@ type InstancesConfig struct {
LogRotationEnabled bool `yaml:"log_rotation_enabled" default:"true"` LogRotationEnabled bool `yaml:"log_rotation_enabled" default:"true"`
// Maximum log file size in MB before rotation // 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 // Whether to compress rotated log files
LogRotationCompress bool `yaml:"log_rotation_compress" default:"false"` 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 TimeoutCheckInterval: 5, // Check timeouts every 5 minutes
LogsDir: "", // Will be set to data_dir/logs if empty LogsDir: "", // Will be set to data_dir/logs if empty
LogRotationEnabled: true, LogRotationEnabled: true,
LogRotationMaxSizeMB: 100, LogRotationMaxSize: 100,
LogRotationCompress: false, LogRotationCompress: false,
}, },
Database: DatabaseConfig{ Database: DatabaseConfig{
@@ -568,9 +568,9 @@ func loadEnvVars(cfg *AppConfig) {
cfg.Instances.LogRotationEnabled = b cfg.Instances.LogRotationEnabled = b
} }
} }
if logRotationMaxSizeMB := os.Getenv("LLAMACTL_LOG_ROTATION_MAX_SIZE_MB"); logRotationMaxSizeMB != "" { if logRotationMaxSize := os.Getenv("LLAMACTL_LOG_ROTATION_MAX_SIZE"); logRotationMaxSize != "" {
if m, err := strconv.Atoi(logRotationMaxSizeMB); err == nil { if m, err := strconv.Atoi(logRotationMaxSize); err == nil {
cfg.Instances.LogRotationMaxSizeMB = m cfg.Instances.LogRotationMaxSize = m
} }
} }
if logRotationCompress := os.Getenv("LLAMACTL_LOG_ROTATION_COMPRESS"); logRotationCompress != "" { if logRotationCompress := os.Getenv("LLAMACTL_LOG_ROTATION_COMPRESS"); logRotationCompress != "" {

View File

@@ -71,7 +71,7 @@ func New(name string, globalConfig *config.AppConfig, opts *Options, onStatusCha
if !instance.IsRemote() { if !instance.IsRemote() {
logRotationConfig := &LogRotationConfig{ logRotationConfig := &LogRotationConfig{
Enabled: globalInstanceSettings.LogRotationEnabled, Enabled: globalInstanceSettings.LogRotationEnabled,
MaxSizeMB: globalInstanceSettings.LogRotationMaxSizeMB, MaxSizeMB: globalInstanceSettings.LogRotationMaxSize,
Compress: globalInstanceSettings.LogRotationCompress, Compress: globalInstanceSettings.LogRotationCompress,
} }
instance.logger = newLogger( instance.logger = newLogger(