Change store.Sync to store.List
This commit is contained in:
@@ -66,9 +66,9 @@ func New(opts ...options.Option) (store.Store, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// In the cloudflare workers KV implemention, Sync() doesn't guarantee
|
||||
// In the cloudflare workers KV implemention, List() doesn't guarantee
|
||||
// anything as the workers API is eventually consistent.
|
||||
func (w *workersKV) Sync() ([]*store.Record, error) {
|
||||
func (w *workersKV) List() ([]*store.Record, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
|
||||
|
@@ -31,11 +31,11 @@ func TestCloudflare(t *testing.T) {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
records, err := wkv.Sync()
|
||||
records, err := wkv.List()
|
||||
if err != nil {
|
||||
t.Fatalf("Sync: %s\n", err.Error())
|
||||
t.Fatalf("List: %s\n", err.Error())
|
||||
} else {
|
||||
t.Log("Synced " + strconv.Itoa(len(records)) + " records")
|
||||
t.Log("Listed " + strconv.Itoa(len(records)) + " records")
|
||||
}
|
||||
|
||||
err = wkv.Write(
|
||||
|
Reference in New Issue
Block a user