This commit is contained in:
parent
15d8966971
commit
2d4a0347d6
1 changed files with 15 additions and 0 deletions
15
main.go
15
main.go
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
|
|
@ -147,6 +148,20 @@ func main() {
|
||||||
|
|
||||||
log.Debug().Str("report url", config.DomainRMO).Str("sync url", config.DomainNidus).Msg("Serving at URLs")
|
log.Debug().Str("report url", config.DomainRMO).Str("sync url", config.DomainNidus).Msg("Serving at URLs")
|
||||||
|
|
||||||
|
// Start pprof debug server on a separate port (localhost-only for security).
|
||||||
|
// Tunnels and Staging builds can set PPROF_BIND to override.
|
||||||
|
// Access via: curl http://localhost:6060/debug/pprof/goroutine?debug=1
|
||||||
|
pprofBind := os.Getenv("PPROF_BIND")
|
||||||
|
if pprofBind == "" {
|
||||||
|
pprofBind = "localhost:6060"
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
log.Info().Str("address", pprofBind).Msg("Starting pprof debug server")
|
||||||
|
if err := http.ListenAndServe(pprofBind, nil); err != nil {
|
||||||
|
log.Error().Err(err).Msg("pprof server stopped")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
openai_logger := log.With().Logger()
|
openai_logger := log.With().Logger()
|
||||||
err = llm.CreateOpenAIClient(ctx, &openai_logger)
|
err = llm.CreateOpenAIClient(ctx, &openai_logger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue