pprof.go 250 B

12345678910111213141516171819202122
  1. //go:build pprof
  2. // +build pprof
  3. package main
  4. import (
  5. "net/http"
  6. _ "net/http/pprof"
  7. "os"
  8. )
  9. func init() {
  10. bind := os.Getenv("IMGPROXY_PPROF_BIND")
  11. if len(bind) == 0 {
  12. bind = ":8088"
  13. }
  14. go func() {
  15. http.ListenAndServe(bind, nil)
  16. }()
  17. }