Add expo backoff

Former-commit-id: faae551aca
This commit is contained in:
Owen
2026-01-12 12:20:59 -08:00
parent 1ed27fec1a
commit 5b637bb4ca
5 changed files with 123 additions and 25 deletions

View File

@@ -5,6 +5,8 @@ import (
"encoding/json"
"fmt"
"net"
"net/http"
_ "net/http/pprof"
"os"
"runtime"
"strconv"
@@ -101,6 +103,16 @@ func Init(ctx context.Context, config GlobalConfig) {
logger.GetLogger().SetLevel(util.ParseLogLevel(config.LogLevel))
// Start pprof server if enabled
if config.PprofAddr != "" {
go func() {
logger.Info("Starting pprof server on %s", config.PprofAddr)
if err := http.ListenAndServe(config.PprofAddr, nil); err != nil {
logger.Error("Failed to start pprof server: %v", err)
}
}()
}
logger.Debug("Checking permissions for native interface")
err := permissions.CheckNativeInterfacePermissions()
if err != nil {

View File

@@ -23,6 +23,9 @@ type GlobalConfig struct {
Version string
Agent string
// Debugging
PprofAddr string // Address to serve pprof on (e.g., "localhost:6060")
// Callbacks
OnRegistered func()
OnConnected func()