From d084b8c621a941c0d2429bf18b082c0e010ed000 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 12 Jan 2025 18:01:12 +0800 Subject: Rename db -> global_db --- config.go | 4 ++-- 1 file 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 -- cgit v1.2.3