1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/sync/store/cache_test.go
Jake Sanders c91bf7e9e7
[WIP] Store Sync (#1365)
* Initial cache implementation

* Write queue implementation

* Accidentally started writing the storage sync service
2020-03-18 16:39:36 +00:00

27 lines
494 B
Go

package store
import (
"context"
"testing"
"time"
"github.com/micro/go-micro/v2/store"
"github.com/micro/go-micro/v2/store/memory"
)
func TestCacheTicker(t *testing.T) {
l0 := memory.NewStore()
l0.Init()
l1 := memory.NewStore()
l1.Init()
l2 := memory.NewStore()
l2.Init()
c := NewCache(Stores(l0, l1, l2), SyncInterval(1*time.Second), SyncMultiplier(2))
if err := c.Init(store.WithContext(context.Background())); err != nil {
t.Fatal(err)
}
time.Sleep(30 * time.Second)
}