use ttlcache (#2677)

* use ttlcache

* go

* test
This commit is contained in:
Paul Wells
2024-04-23 02:20:54 -07:00
committed by GitHub
parent f239f8bff1
commit c51b3e3fe2
6 changed files with 64 additions and 86 deletions
+18
View File
@@ -0,0 +1,18 @@
package utils
import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/livekit/protocol/livekit"
)
func TestIceConfigCache(t *testing.T) {
cache := NewIceConfigCache[string](10 * time.Second)
t.Cleanup(cache.Stop)
cache.Put("test", &livekit.ICEConfig{})
require.NotNil(t, cache)
}