mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-11 19:18:12 -07:00
(tested) rollback to separate v4 and v6 keys in redis/keydb
* sanitize log fields * remove miniredis dependency * store/collect information about hybrid (v2to1) hashes
This commit is contained in:
@@ -5,8 +5,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/alicebob/miniredis"
|
||||
|
||||
s "github.com/sot-tech/mochi/storage"
|
||||
"github.com/sot-tech/mochi/storage/test"
|
||||
)
|
||||
@@ -22,19 +20,9 @@ var cfg = Config{
|
||||
func createNew() s.PeerStorage {
|
||||
var ps s.PeerStorage
|
||||
var err error
|
||||
ps, err = New(cfg)
|
||||
ps, err = newStore(cfg)
|
||||
if err != nil {
|
||||
fmt.Println("unable to create real redis connection: ", err, " using simulator")
|
||||
var rs *miniredis.Miniredis
|
||||
rs, err = miniredis.Run()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
cfg.Addresses = []string{rs.Addr()}
|
||||
ps, err = New(cfg)
|
||||
}
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(fmt.Sprint("Unable to create KeyDB connection: ", err, "\nThis driver needs real Redis instance"))
|
||||
}
|
||||
return ps
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user