fix: 修复 Docker Compose 环境下 PostgreSQL 连接失败

This commit is contained in:
hhs
2026-06-14 20:47:00 +08:00
parent 9dc9025d10
commit 1ddd75d34f
3 changed files with 12 additions and 1 deletions

View File

@@ -56,6 +56,10 @@ func main() {
var sessRepo store.SessionRepository
if cfg.Storage.Driver == "postgres" {
if cfg.Storage.DSN == "" {
logger.Log.Fatalw("storage.dsn is required when storage.driver is postgres",
"hint", "set CAMTALK_STORAGE_DSN environment variable")
}
pool, err := store.NewPostgresPool(ctx, cfg.Storage.DSN)
if err != nil {
logger.Log.Fatalw("failed to connect to postgres", "error", err)