From 2c6bae6612eab2cc101d1b3f8efa2f08d07b2436 Mon Sep 17 00:00:00 2001 From: Jakob Gillich Date: Thu, 4 Apr 2024 02:52:53 +0200 Subject: [PATCH] chore: launch pprof server in build mode --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index 564facab..65c77cc2 100644 --- a/main.go +++ b/main.go @@ -2,8 +2,12 @@ package main import ( "log" + "os" "github.com/getseabird/seabird/internal/ui" + + "net/http" + _ "net/http/pprof" ) var ( @@ -13,6 +17,12 @@ var ( ) func main() { + if os.Getenv("SEABIRD_DEV") == "1" { + go func() { + log.Println(http.ListenAndServe("localhost:6060", nil)) + }() + } + ui.Version = version app, err := ui.NewApplication(version) if err != nil {