moved db conn variable to db.go
This commit is contained in:
parent
5a481121d2
commit
b47bd9ed56
@ -6,6 +6,8 @@ import (
|
|||||||
"github.com/jackc/pgx/v4/pgxpool"
|
"github.com/jackc/pgx/v4/pgxpool"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var pool *pgxpool.Pool
|
||||||
|
|
||||||
func getDbPool() *pgxpool.Pool {
|
func getDbPool() *pgxpool.Pool {
|
||||||
// Setup Database
|
// Setup Database
|
||||||
dbURI := fmt.Sprintf("postgres://%s:%s@%s:%d/fedilogue", settings.Database.Username, settings.Database.Password, settings.Database.Host, settings.Database.Port)
|
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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/jackc/pgx/v4/pgxpool"
|
|
||||||
"github.com/microcosm-cc/bluemonday"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
"github.com/microcosm-cc/bluemonday"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Current instances
|
// Current instances
|
||||||
var runninginstances map[string]RunningInstance
|
var runninginstances map[string]RunningInstance
|
||||||
var ri_mutex = &sync.Mutex{}
|
var ri_mutex = &sync.Mutex{}
|
||||||
var pool *pgxpool.Pool
|
|
||||||
|
|
||||||
func startpprof() {
|
func startpprof() {
|
||||||
logInfo("Starting http/pprof on :7777")
|
logInfo("Starting http/pprof on :7777")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user