mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-07-04 23:42:19 +02:00
Compare commits
No commits in common. "fadd10602afbcc451f830cde7099e7fc23c56b17" and "59ea469fb68182b1ab1c3135e88f2e4aca4efb20" have entirely different histories.
fadd10602a
...
59ea469fb6
@ -18,7 +18,6 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
@ -281,10 +280,6 @@ func handleSaveData(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case "/savedata/get":
|
||||
save, err = savedata.Get(uuid, datatype, slot)
|
||||
if err == sql.ErrNoRows {
|
||||
http.Error(w, err.Error(), http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
case "/savedata/update":
|
||||
err = savedata.Update(uuid, slot, save)
|
||||
case "/savedata/delete":
|
||||
|
13
db/db.go
13
db/db.go
@ -38,15 +38,10 @@ func Init(username, password, protocol, address, database string) error {
|
||||
return fmt.Errorf("failed to open database connection: %s", err)
|
||||
}
|
||||
|
||||
conns := 1024
|
||||
if protocol != "unix" {
|
||||
conns = 256
|
||||
}
|
||||
|
||||
handle.SetMaxOpenConns(conns)
|
||||
handle.SetMaxIdleConns(conns/4)
|
||||
|
||||
handle.SetConnMaxIdleTime(time.Second * 10)
|
||||
handle.SetMaxIdleConns(256)
|
||||
handle.SetMaxOpenConns(256)
|
||||
handle.SetConnMaxIdleTime(time.Second * 30)
|
||||
handle.SetConnMaxLifetime(time.Minute)
|
||||
|
||||
tx, err := handle.Begin()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user