engine refactor
This commit is contained in:
parent
9e663db9dc
commit
81b8e763bd
37 changed files with 3532 additions and 1639 deletions
|
|
@ -28,6 +28,12 @@ type Config struct {
|
|||
// HTTPConfig configures the HTTP server.
|
||||
type HTTPConfig struct {
|
||||
Port int `yaml:"port"`
|
||||
// AsyncWorkers caps concurrent prediction executions for the async endpoint.
|
||||
AsyncWorkers int `yaml:"async_workers"`
|
||||
// AsyncQueueSize bounds the async pending queue.
|
||||
AsyncQueueSize int `yaml:"async_queue_size"`
|
||||
// AsyncResultTTL is how long completed async results are retained.
|
||||
AsyncResultTTL time.Duration `yaml:"async_result_ttl"`
|
||||
}
|
||||
|
||||
// DataConfig configures dataset and elevation storage.
|
||||
|
|
@ -60,11 +66,16 @@ type LogConfig struct {
|
|||
// Defaults returns a Config with reasonable default values.
|
||||
func Defaults() Config {
|
||||
return Config{
|
||||
HTTP: HTTPConfig{Port: 8080},
|
||||
HTTP: HTTPConfig{
|
||||
Port: 8080,
|
||||
AsyncWorkers: 4,
|
||||
AsyncQueueSize: 64,
|
||||
AsyncResultTTL: time.Hour,
|
||||
},
|
||||
Data: DataConfig{
|
||||
Dir: "/tmp/predictor-data",
|
||||
ElevationPath: "/srv/ruaumoko-dataset",
|
||||
Source: "noaa-gfs-0p50",
|
||||
Source: "gfs-0p50-3h",
|
||||
},
|
||||
Download: DownloadConfig{
|
||||
Parallel: 8,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue