move redis config over to config file
This commit is contained in:
@@ -19,12 +19,9 @@ func (m *RedisStore[Value]) RedisHash(value_to_hash string) string {
|
||||
return m.prefix + HashKey(value_to_hash)
|
||||
}
|
||||
|
||||
func NewRedisStore[Value any]() *RedisStore[Value] {
|
||||
func NewRedisStore[Value any](redis_server string, prefix string) *RedisStore[Value] {
|
||||
logging.Debug("Creating new redis session store")
|
||||
|
||||
// this will be replaced with a URL that can be parsed in the config file
|
||||
redis_server := "redis://localhost:6379/0"
|
||||
|
||||
opts, err := redis.ParseURL(redis_server)
|
||||
if err != nil {
|
||||
logging.Errorf("Failed to parse redis url %s", err.Error())
|
||||
@@ -42,7 +39,7 @@ func NewRedisStore[Value any]() *RedisStore[Value] {
|
||||
store := &RedisStore[Value]{
|
||||
client: rdb,
|
||||
ctx: ctx,
|
||||
prefix: "random_string_1",
|
||||
prefix: prefix,
|
||||
}
|
||||
return store
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user