make LRU cache global for internode tokens (#19555)

This commit is contained in:
Harshavardhana
2024-04-19 09:45:14 -07:00
committed by GitHub
parent ec816f3840
commit cd50e9b4bc
2 changed files with 20 additions and 25 deletions
+2 -3
View File
@@ -22,7 +22,6 @@ import (
"net/http"
"os"
"testing"
"time"
jwtgo "github.com/golang-jwt/jwt/v4"
xjwt "github.com/minio/minio/internal/jwt"
@@ -181,11 +180,11 @@ func BenchmarkAuthenticateNode(b *testing.B) {
}
})
b.Run("cached", func(b *testing.B) {
fn := cachedAuthenticateNode(time.Second)
fn := newCachedAuthToken()
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
fn(creds.AccessKey, creds.SecretKey, "aud")
fn("aud")
}
})
}