diff options
author | Grail Finder <wohilas@gmail.com> | 2025-08-08 13:33:07 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-08-08 13:33:07 +0300 |
commit | 3b7784e0a44e7f8ca5c14db590ebdfe1736e87e5 (patch) | |
tree | 6127376793b714812fa4a98d0e5ea9d839b8d9de | |
parent | 972d9cdbffad19efbf2bb05f2f91e31d09120e32 (diff) |
Chore: db path to config
-rw-r--r-- | bot.go | 3 | ||||
-rw-r--r-- | config.example.toml | 1 | ||||
-rw-r--r-- | config/config.go | 2 |
3 files changed, 4 insertions, 2 deletions
@@ -551,8 +551,7 @@ func init() { // logLevel.Set(slog.LevelInfo) logger = slog.New(slog.NewTextHandler(logfile, &slog.HandlerOptions{Level: logLevel})) - // TODO: rename and/or put in cfg - store = storage.NewProviderSQL("test.db", logger) + store = storage.NewProviderSQL(cfg.DBPATH, logger) if store == nil { os.Exit(1) } diff --git a/config.example.toml b/config.example.toml index 731383b..4e9a816 100644 --- a/config.example.toml +++ b/config.example.toml @@ -21,3 +21,4 @@ TTS_SPEED = 1.0 # extra stt STT_ENABLED = false STT_URL = "http://localhost:8081/inference" +DBPATH = "gflt.db" diff --git a/config/config.go b/config/config.go index 110cd75..76d7519 100644 --- a/config/config.go +++ b/config/config.go @@ -53,6 +53,7 @@ type Config struct { // STT STT_URL string `toml:"STT_URL"` STT_ENABLED bool `toml:"STT_ENABLED"` + DBPATH string `toml:"DBPATH"` } func LoadConfigOrDefault(fn string) *Config { @@ -78,6 +79,7 @@ func LoadConfigOrDefault(fn string) *Config { config.AssistantRole = "assistant" config.SysDir = "sysprompts" config.ChunkLimit = 8192 + config.DBPATH = "gflt.db" // config.RAGBatchSize = 100 config.RAGWordLimit = 80 |