move redis config over to config file

This commit is contained in:
Gregory Wells
2026-06-08 18:54:31 -04:00
parent 40429d7618
commit 109199ea45
5 changed files with 21 additions and 12 deletions
+2 -5
View File
@@ -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
}