pprof.go 233 B

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