moved db conn variable to db.go

This commit is contained in:
farhan 2021-02-13 02:48:11 +00:00
parent 5a481121d2
commit b47bd9ed56
2 changed files with 3 additions and 3 deletions

@ -6,6 +6,8 @@ import (
"github.com/jackc/pgx/v4/pgxpool"
)
var pool *pgxpool.Pool
func getDbPool() *pgxpool.Pool {
// Setup Database
dbURI := fmt.Sprintf("postgres://%s:%s@%s:%d/fedilogue", settings.Database.Username, settings.Database.Password, settings.Database.Host, settings.Database.Port)

@ -1,20 +1,18 @@
package main
import (
"github.com/jackc/pgx/v4/pgxpool"
"github.com/microcosm-cc/bluemonday"
"net/http"
_ "net/http/pprof"
"regexp"
"runtime"
"sync"
"time"
"github.com/microcosm-cc/bluemonday"
)
// Current instances
var runninginstances map[string]RunningInstance
var ri_mutex = &sync.Mutex{}
var pool *pgxpool.Pool
func startpprof() {
logInfo("Starting http/pprof on :7777")