Improve caching, move mutex to the cache implementation
This commit is contained in:
@@ -70,7 +70,9 @@ func TestLogs_Get(t *testing.T) {
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
t.Cleanup(cancel)
|
||||
|
||||
logger := zaptest.NewLogger(t)
|
||||
|
||||
require.NoError(t, application.Migrate(ctx, db, logger))
|
||||
@@ -96,7 +98,7 @@ func TestLogs_Get(t *testing.T) {
|
||||
_, err = db.NewInsert().Model(&testData).Exec(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
repo, err := NewConnLogs(ctx, db, make(inmemorycache.Cache), logger, time.Millisecond*100)
|
||||
repo, err := NewConnLogs(ctx, db, inmemorycache.NewCache(), logger, time.Millisecond*100)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("found dup", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user