mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-04-03 03:27:13 +08:00
Run formatter on files
This commit is contained in:
parent
a8502fcd3f
commit
693663103b
@ -89,4 +89,4 @@ func uuidFromRequest(r *http.Request) ([]byte, error) {
|
|||||||
func httpError(w http.ResponseWriter, r *http.Request, err error, code int) {
|
func httpError(w http.ResponseWriter, r *http.Request, err error, code int) {
|
||||||
log.Printf("%s: %s\n", r.URL.Path, err)
|
log.Printf("%s: %s\n", r.URL.Path, err)
|
||||||
http.Error(w, err.Error(), code)
|
http.Error(w, err.Error(), code)
|
||||||
}
|
}
|
||||||
|
4
db/db.go
4
db/db.go
@ -37,14 +37,14 @@ func Init(username, password, protocol, address, database string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to open database connection: %s", err)
|
return fmt.Errorf("failed to open database connection: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
conns := 1024
|
conns := 1024
|
||||||
if protocol != "unix" {
|
if protocol != "unix" {
|
||||||
conns = 256
|
conns = 256
|
||||||
}
|
}
|
||||||
|
|
||||||
handle.SetMaxOpenConns(conns)
|
handle.SetMaxOpenConns(conns)
|
||||||
handle.SetMaxIdleConns(conns/4)
|
handle.SetMaxIdleConns(conns / 4)
|
||||||
|
|
||||||
handle.SetConnMaxIdleTime(time.Second * 10)
|
handle.SetConnMaxIdleTime(time.Second * 10)
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ func main() {
|
|||||||
dbname := flag.String("dbname", "pokeroguedb", "database name")
|
dbname := flag.String("dbname", "pokeroguedb", "database name")
|
||||||
|
|
||||||
tlscert := flag.String("tlscert", "", "tls certificate path")
|
tlscert := flag.String("tlscert", "", "tls certificate path")
|
||||||
tlskey := flag.String("tlskey", "", "tls key path")
|
tlskey := flag.String("tlskey", "", "tls key path")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
@ -130,4 +130,3 @@ func debugHandler(router *http.ServeMux) http.Handler {
|
|||||||
router.ServeHTTP(w, r)
|
router.ServeHTTP(w, r)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user