Commit Graph
1 Commits
Author SHA1 Message Date
Guilherme Souza 3fce4dbcca fix(whatsmeow): share one sqlstore.Container for auth DB
StartClient called sqlstore.New on every instance start, opening a new
*sql.DB and re-running Upgrade against PostgresAuthDB. A few parallel
QR/reconnects saturated PgBouncer (75 = 60+15) with bad connection.

Reuse the pooled authDB from initPostgresAuthDB via NewWithDB + Upgrade
once (sync.Once on a heap-allocated sharedSQLStore so value-receiver
StartClient is safe). Users/GORM DB stays separate. Do not Close the
shared container on disconnect — main owns authDB.

(cherry picked from commit f2a73c715a286aefa5c10fa8521dccc7efa56581)
2026-11-09 12:01:15 -03:00