Update configuration defaults for server and executor settings
This commit is contained in:
@@ -8,10 +8,10 @@ import (
|
||||
|
||||
// Config holds all configuration for the application
|
||||
type Config struct {
|
||||
Server ServerConfig
|
||||
Executor ExecutorConfig
|
||||
Languages map[string]LanguageConfig
|
||||
Sandbox SandboxConfig
|
||||
Server ServerConfig
|
||||
Executor ExecutorConfig
|
||||
Languages map[string]LanguageConfig
|
||||
Sandbox SandboxConfig
|
||||
}
|
||||
|
||||
// ServerConfig holds server-related configurations
|
||||
@@ -31,15 +31,15 @@ type ExecutorConfig struct {
|
||||
|
||||
// LanguageConfig holds language-specific configurations
|
||||
type LanguageConfig struct {
|
||||
Name string
|
||||
Image string
|
||||
MemoryLimit string
|
||||
CPULimit string
|
||||
TimeoutSec int
|
||||
CompileCmd []string
|
||||
RunCmd []string
|
||||
FileExt string
|
||||
VersionCmd []string
|
||||
Name string
|
||||
Image string
|
||||
MemoryLimit string
|
||||
CPULimit string
|
||||
TimeoutSec int
|
||||
CompileCmd []string
|
||||
RunCmd []string
|
||||
FileExt string
|
||||
VersionCmd []string
|
||||
}
|
||||
|
||||
// SandboxConfig holds sandbox-related configurations
|
||||
@@ -56,11 +56,11 @@ func GetConfig() *Config {
|
||||
Port: getEnv("PORT", "8080"),
|
||||
ReadTimeout: time.Duration(getEnvAsInt("READ_TIMEOUT", 15)) * time.Second,
|
||||
WriteTimeout: time.Duration(getEnvAsInt("WRITE_TIMEOUT", 15)) * time.Second,
|
||||
IdleTimeout: time.Duration(getEnvAsInt("IDLE_TIMEOUT", 60)) * time.Second,
|
||||
IdleTimeout: time.Duration(getEnvAsInt("IDLE_TIMEOUT", 90)) * time.Second,
|
||||
},
|
||||
Executor: ExecutorConfig{
|
||||
ConcurrentExecutions: getEnvAsInt("CONCURRENT_EXECUTIONS", 5),
|
||||
QueueCapacity: getEnvAsInt("QUEUE_CAPACITY", 100),
|
||||
ConcurrentExecutions: getEnvAsInt("CONCURRENT_EXECUTIONS", 100),
|
||||
QueueCapacity: getEnvAsInt("QUEUE_CAPACITY", 1000),
|
||||
DefaultTimeout: time.Duration(getEnvAsInt("DEFAULT_TIMEOUT", 30)) * time.Second,
|
||||
},
|
||||
Languages: getLanguageConfigs(),
|
||||
|
||||
Reference in New Issue
Block a user