From aa6dbfefb3209862df25d7dc07e1736ac38f9cad Mon Sep 17 00:00:00 2001 From: Beyhan Ogur Date: Mon, 11 May 2026 17:08:48 +0300 Subject: [PATCH] feat: add DB_TIMEZONE configuration and update logging for PostgreSQL timezone --- .env.example | 4 ++-- config/config.go | 3 +++ data/app.db | Bin 61440 -> 94208 bytes docs/wiki/Config.md | 1 + main.go | 25 ++++++++++++++++++++++++- 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 8877e6a..23f4942 100644 --- a/.env.example +++ b/.env.example @@ -8,7 +8,7 @@ OPENAI_MODEL=deepseek-v4-pro DB_MODE=sqlite #DB_MODE=pgs DB_PATH=./data/app.db -LOG_LEVEL=warn +LOG_LEVEL=info STREAMING=true - +DB_TIMEZONE=Europe/Istanbul diff --git a/config/config.go b/config/config.go index c832055..602fd81 100644 --- a/config/config.go +++ b/config/config.go @@ -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, } } diff --git a/data/app.db b/data/app.db index b121c89e6efd48d925f03fa836a6dad9d09676c6..b727aea3c2c3f79f1ae4f9199e2a9c63ca36181f 100644 GIT binary patch delta 1152 zcmZ{iPiPZC6vlUxZc|Fqmw%gowoMQZN|R-FXJ#iGkt&{4w3dRN3MNfUh164TB5hC) zLXp%J^`JINtp`0c20eHwhzMRHR0J0UGCk_PekGzYK$Ws;RvZ5!4O9v$l>>M0Mr{v-QSbwE? zfb|?Enq?wt=@!b`o7M2{T76Uv_4Fy9ecYK#9+W(H<-uAxC=V@M40@%pG3lh5ynV^# zGLT_r5Y6a%N~bx3b5z%m!Az7Tmi@D;LVL-wM^$Pcn#R8Ae5o`!J9~a6RhYa`-+b^! zw!NiOZj7ev@lw1S=W&r9wBMBy_3@k2ZbgwR`G7Fr$ITO6!-mf78^m55P=)uF5_P`1vpjL(uj535;D3i5{g^X#^ zqCP<_ipkWCq@f%xR`O9X3*mYsM-7dyjZ%}x-0{lxmS!YfkDN&2+cIX3W;JHnAOiyf|3n3QM!}5