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
|
// Config holds all configuration for the application
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Server ServerConfig
|
Server ServerConfig
|
||||||
Executor ExecutorConfig
|
Executor ExecutorConfig
|
||||||
Languages map[string]LanguageConfig
|
Languages map[string]LanguageConfig
|
||||||
Sandbox SandboxConfig
|
Sandbox SandboxConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerConfig holds server-related configurations
|
// ServerConfig holds server-related configurations
|
||||||
@@ -31,15 +31,15 @@ type ExecutorConfig struct {
|
|||||||
|
|
||||||
// LanguageConfig holds language-specific configurations
|
// LanguageConfig holds language-specific configurations
|
||||||
type LanguageConfig struct {
|
type LanguageConfig struct {
|
||||||
Name string
|
Name string
|
||||||
Image string
|
Image string
|
||||||
MemoryLimit string
|
MemoryLimit string
|
||||||
CPULimit string
|
CPULimit string
|
||||||
TimeoutSec int
|
TimeoutSec int
|
||||||
CompileCmd []string
|
CompileCmd []string
|
||||||
RunCmd []string
|
RunCmd []string
|
||||||
FileExt string
|
FileExt string
|
||||||
VersionCmd []string
|
VersionCmd []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// SandboxConfig holds sandbox-related configurations
|
// SandboxConfig holds sandbox-related configurations
|
||||||
@@ -56,11 +56,11 @@ func GetConfig() *Config {
|
|||||||
Port: getEnv("PORT", "8080"),
|
Port: getEnv("PORT", "8080"),
|
||||||
ReadTimeout: time.Duration(getEnvAsInt("READ_TIMEOUT", 15)) * time.Second,
|
ReadTimeout: time.Duration(getEnvAsInt("READ_TIMEOUT", 15)) * time.Second,
|
||||||
WriteTimeout: time.Duration(getEnvAsInt("WRITE_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{
|
Executor: ExecutorConfig{
|
||||||
ConcurrentExecutions: getEnvAsInt("CONCURRENT_EXECUTIONS", 5),
|
ConcurrentExecutions: getEnvAsInt("CONCURRENT_EXECUTIONS", 100),
|
||||||
QueueCapacity: getEnvAsInt("QUEUE_CAPACITY", 100),
|
QueueCapacity: getEnvAsInt("QUEUE_CAPACITY", 1000),
|
||||||
DefaultTimeout: time.Duration(getEnvAsInt("DEFAULT_TIMEOUT", 30)) * time.Second,
|
DefaultTimeout: time.Duration(getEnvAsInt("DEFAULT_TIMEOUT", 30)) * time.Second,
|
||||||
},
|
},
|
||||||
Languages: getLanguageConfigs(),
|
Languages: getLanguageConfigs(),
|
||||||
|
|||||||
Reference in New Issue
Block a user