X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1e094e23db422cabe013ecbf7a0b465c4b096e12..7cb536fa58d8cc837b4cb59680c7355a1687648b:/services/ws/main.go diff --git a/services/ws/main.go b/services/ws/main.go index 9a24b312b0..0f978231b9 100644 --- a/services/ws/main.go +++ b/services/ws/main.go @@ -10,6 +10,8 @@ import ( "git.curoverse.com/arvados.git/sdk/go/config" ) +var debugLogf = func(string, ...interface{}) {} + func main() { configPath := flag.String("config", "/etc/arvados/ws/ws.yml", "`path` to config file") dumpConfig := flag.Bool("dump-config", false, "show current configuration and exit") @@ -20,6 +22,9 @@ func main() { if err != nil { log.Fatal(err) } + if cfg.Debug { + debugLogf = log.Printf + } if *dumpConfig { txt, err := config.Dump(&cfg) @@ -36,10 +41,11 @@ func main() { WriteTimeout: time.Minute, MaxHeaderBytes: 1 << 20, Handler: &router{ - EventSource: (&pgEventSource{ + Config: &cfg, + eventSource: &pgEventSource{ PgConfig: cfg.Postgres, QueueSize: cfg.ServerEventQueue, - }).EventSource(), + }, }, } log.Fatal(srv.ListenAndServe())