feat: add DB_TIMEZONE configuration and update logging for PostgreSQL timezone

This commit is contained in:
Beyhan Ogur
2026-05-11 17:08:48 +03:00
parent c56ae7194c
commit aa6dbfefb3
5 changed files with 30 additions and 3 deletions
+3
View File
@@ -17,6 +17,7 @@ type Config struct {
RequestTimeoutSeconds int
OpenAIModel string // default model when client omits it
Streaming bool // enable/disable SSE streaming responses
DBTimezone string // PostgreSQL session timezone (e.g. "Europe/Istanbul")
}
// Load reads environment variables and returns a populated Config.
@@ -51,6 +52,7 @@ func Load() *Config {
openAIApiKey := os.Getenv("OPENAI_KEY")
openAIModel := os.Getenv("OPENAI_MODEL")
dbTimezone := os.Getenv("DB_TIMEZONE")
streaming := true
if v := os.Getenv("STREAMING"); v != "" {
@@ -70,5 +72,6 @@ func Load() *Config {
RequestTimeoutSeconds: timeoutSec,
OpenAIModel: openAIModel,
Streaming: streaming,
DBTimezone: dbTimezone,
}
}