From bb5d8a154b6ac5571e3af85b66e3663ddb7dbd84 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Tue, 3 Feb 2026 17:12:20 -0700 Subject: [PATCH] oyeah i dont need redis client if i am parsing protocol --- src/config.go | 17 ----------------- src/main.go | 1 - 2 files changed, 18 deletions(-) diff --git a/src/config.go b/src/config.go index b26f0b7..38bdb72 100644 --- a/src/config.go +++ b/src/config.go @@ -4,8 +4,6 @@ import ( "context" "encoding/json" "os" - - valkey "github.com/redis/go-redis/v9" ) type Config struct { @@ -13,8 +11,6 @@ type Config struct { ConnectionDriver string `json:"CONNECTION_DRIVER"` ConnectionString string `json:"CONNECTION_STRING"` db DB - KeyValueURL string `json:"KEY_VALUE_URL"` - keyValue *valkey.Client } func NewConfig(ctx context.Context) (Config, error) { @@ -23,20 +19,8 @@ func NewConfig(ctx context.Context) (Config, error) { return config, err } - opt, err := valkey.ParseURL(config.KeyValueURL) - if err != nil { - return config, err - } - client := valkey.NewClient(opt) - if err := client.Ping(ctx).Err(); err != nil { - client.Close() - return config, err - } - config.keyValue = client - db, err := NewDB(ctx, config.ConnectionDriver, config.ConnectionString) if err != nil { - client.Close() return config, err } config.db = db @@ -49,7 +33,6 @@ func newConfig() (Config, error) { Listen: ":10000", ConnectionDriver: "sqlite", ConnectionString: "/tmp/red-apter.db", - KeyValueURL: "redis://localhost:6379", } b, _ := json.Marshal(config) var m map[string]any diff --git a/src/main.go b/src/main.go index 3d4bd3c..5601a06 100644 --- a/src/main.go +++ b/src/main.go @@ -10,7 +10,6 @@ func Main(ctx context.Context) error { return err } defer config.db.Close() - defer config.keyValue.Close() if err := listen(ctx, config); err != nil && ctx.Err() == nil { return err