11package config
22
3+ import "time"
4+
35type InvokerConfig struct {
6+ // PublicAddress defines address for public access to invoker from master if the server is set up locally with some proxy
7+ PublicAddress * string `yaml:"PublicAddress,omitempty"`
8+
49 Threads uint64 `yaml:"Threads"`
510 Sandboxes uint64 `yaml:"Sandboxes"`
611 QueueSize uint64 `yaml:"QueueSize"`
712
813 SandboxType string `yaml:"SandboxType"`
914 SandboxHomePath string `yaml:"SandboxHomePath"`
1015
16+ MasterPingInterval time.Duration `yaml:"MasterPingInterval"`
17+
1118 CacheSize uint64 `yaml:"CacheSize"`
1219 CachePath string `yaml:"CachePath"`
1320
1421 SaveOutputHead * uint64 `yaml:"SaveOutputHead,omitempty"`
1522
1623 CompilerConfigsFolder string `yaml:"CompilerConfigsFolder"`
1724
18- CheckerLimits * RunConfig `yaml:"CheckerLimits,omitempty"`
25+ CheckerLimits * RunLimitsConfig `yaml:"CheckerLimits,omitempty"`
1926}
2027
2128func FillInInvokerConfig (config * InvokerConfig ) {
@@ -36,10 +43,15 @@ func FillInInvokerConfig(config *InvokerConfig) {
3643 switch config .SandboxType {
3744 case "simple" :
3845 panic ("No sandbox home path specified" )
46+ case "isolate" :
47+ panic ("No isolate home path specified (it is used for meta files)" )
3948 default :
4049 panic ("unsupported sandbox type: " + config .SandboxType )
4150 }
4251 }
52+ if config .MasterPingInterval == 0 {
53+ config .MasterPingInterval = time .Second * 10
54+ }
4355 if len (config .CachePath ) == 0 {
4456 panic ("No invoker cache path specified" )
4557 }
@@ -51,7 +63,7 @@ func FillInInvokerConfig(config *InvokerConfig) {
5163 }
5264
5365 if config .CheckerLimits == nil {
54- config .CheckerLimits = & RunConfig {}
66+ config .CheckerLimits = & RunLimitsConfig {}
5567 }
56- fillInDefaultCheckerRunConfig (config .CheckerLimits )
68+ fillInDefaultCheckerRunLimitsConfig (config .CheckerLimits )
5769}
0 commit comments