fix(backend): don't crash if redis isn't set, use tx in CreateMember

This commit is contained in:
Sam 2022-11-24 13:41:36 +01:00
parent 3b64ba33f6
commit d58208f5ac
3 changed files with 23 additions and 2 deletions

20
backend/db/redis.go Normal file
View file

@ -0,0 +1,20 @@
package db
import (
"context"
"net"
"emperror.dev/errors"
"github.com/mediocregopher/radix/v4"
)
var _ radix.Client = (*dummyRedis)(nil)
type dummyRedis struct{}
func (*dummyRedis) Addr() net.Addr { return &net.IPAddr{} }
func (*dummyRedis) Close() error { return nil }
func (*dummyRedis) Do(context.Context, radix.Action) error {
return errors.Sentinel("this is a dummy client")
}