Skip to content

Commit

Permalink
chore: keep pgs ssh pprof
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Jul 8, 2024
1 parent 54ad488 commit 6f47199
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pgs-ssh-pprof.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/pgs/ssh.go b/pgs/ssh.go
index 4d6b097..0bfb1cf 100644
--- a/pgs/ssh.go
+++ b/pgs/ssh.go
@@ -3,6 +3,7 @@ package pgs
import (
"context"
"fmt"
+ "net/http"
"os"
"os/signal"
"syscall"
@@ -113,9 +114,14 @@ func StartSshServer() {
return
}

+ logger.Info("starting SSH server on", "host", host, "port", port)
+
+ go func() {
+ logger.Error("pprof", "err", http.ListenAndServe("0.0.0.0:6060", nil))
+ }()
+
done := make(chan os.Signal, 1)
signal.Notify(done, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
- logger.Info("starting SSH server on", "host", host, "port", port)
go func() {
if err = s.ListenAndServe(); err != nil {
logger.Error("serve", "err", err.Error())

0 comments on commit 6f47199

Please sign in to comment.