diff options
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/cli.go | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -21,10 +21,11 @@ import ( ) var ( - fetchOSM = flag.Bool("fetch-osm", false, "download the France OSM PBF (resumable) into france-latest.osm.pbf") - extractOSM = flag.String("extract-osm", "", "extract mountain passes from an OSM PBF file into the database") - backfill = flag.Bool("backfill", false, "recompute all stored ride values") - backtest = flag.Bool("backtest", false, "run data benchmarks comparing computed values against stored reference values") + fetchOSM = flag.Bool("fetch-osm", false, "download the France OSM PBF (resumable) into france-latest.osm.pbf") + extractOSM = flag.String("extract-osm", "", "extract mountain passes from an OSM PBF file into the database") + backfill = flag.Bool("backfill", false, "recompute all stored ride values") + backtest = flag.Bool("backtest", false, "run data benchmarks comparing computed values against stored reference values") + enablePprof = flag.Bool("pprof", false, "expose pprof endpoints at /debug/pprof") ) const ( @@ -52,7 +53,10 @@ func Run(db *sql.DB, configPath string, appConfig config.Config) { } func runServer(db *sql.DB, configPath string, appConfig config.Config) { - server := web.NewServer(db, configPath) + server := web.NewServer(db, configPath).WithPprof(*enablePprof) + if *enablePprof { + slog.Info("pprof enabled", "endpoint", appConfig.Server.PublicURL+"/debug/pprof/") + } slog.Info("Starting web server", "address", appConfig.Server.PublicURL) kcore.Expect(server.ListenAndServe(appConfig.Server.Address), "web server stopped") } |
