add pprof

This commit is contained in:
Pascal Fischer
2025-03-13 15:53:35 +01:00
parent 2d82d2fb83
commit 1b3471a354
2 changed files with 16 additions and 2 deletions

View File

@@ -6,7 +6,9 @@ import (
b64 "encoding/base64"
"fmt"
"net"
"os"
"slices"
"strconv"
"strings"
"sync"
"time"
@@ -1235,8 +1237,12 @@ func (am *DefaultAccountManager) BufferUpdateAccountPeers(ctx context.Context, a
}
go func() {
time.Sleep(1 * time.Second)
intervalStr := os.Getenv("PEER_UPDATE_INTERVAL_MS")
interval, err := strconv.Atoi(intervalStr)
if err != nil {
interval = 10000
}
time.Sleep(time.Duration(interval) * time.Millisecond)
am.UpdateAccountPeers(ctx, accountID)
am.accountUpdateLocks.Delete(accountID)