aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-01-12 18:01:12 +0800
committerRunxi Yu <me@runxiyu.org>2025-01-12 18:01:12 +0800
commitd084b8c621a941c0d2429bf18b082c0e010ed000 (patch)
tree0951678becc8a57349c462f877bfef4efa328385
parentgo.mod: pgx is a direct import (diff)
downloadmaild-d084b8c621a941c0d2429bf18b082c0e010ed000.tar.gz
maild-d084b8c621a941c0d2429bf18b082c0e010ed000.tar.zst
maild-d084b8c621a941c0d2429bf18b082c0e010ed000.zip
Rename db -> global_db
-rw-r--r--config.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.go b/config.go
index 5098d2c..f8f575e 100644
--- a/config.go
+++ b/config.go
@@ -26,7 +26,7 @@ var config struct {
}
var (
config_mutex sync.RWMutex // covers things like the database too
- db *pgxpool.Pool
+ global_db *pgxpool.Pool
)
// load_config loads the configuration file and sets up global things according
@@ -59,7 +59,7 @@ func load_config(path string) error {
if config.DB.Type != "postgres" {
return err_unsupported_database_type
}
- db, err = pgxpool.New(context.Background(), config.DB.Conn)
+ global_db, err = pgxpool.New(context.Background(), config.DB.Conn)
// BUG: Context-related leak: cancel context when the config is invalidated
if err != nil {
return err