Add optional pprof endpoint for debugging

This commit is contained in:
2026-07-04 21:31:53 +07:00
parent dca1363ec9
commit d5192e1cf7
3 changed files with 16 additions and 0 deletions
+2
View File
@@ -15,6 +15,7 @@ type Config struct {
EncKey []byte
SessionSecret []byte
WorkerConcurrency int
PprofAddr string // if non-empty, serve net/http/pprof here (e.g. ":6060")
}
func Load() (Config, error) {
@@ -25,6 +26,7 @@ func Load() (Config, error) {
AuthPass: os.Getenv("AUTH_PASS"),
SessionSecret: []byte(os.Getenv("SESSION_SECRET")),
WorkerConcurrency: 4,
PprofAddr: os.Getenv("PPROF_ADDR"),
}
if v := os.Getenv("WORKER_CONCURRENCY"); v != "" {
n, err := strconv.Atoi(v)