Compare commits

..

No commits in common. "fadd10602afbcc451f830cde7099e7fc23c56b17" and "59ea469fb68182b1ab1c3135e88f2e4aca4efb20" have entirely different histories.

2 changed files with 4 additions and 14 deletions

View File

@ -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":

View File

@ -37,16 +37,11 @@ func Init(username, password, protocol, address, database string) error {
if err != nil {
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 {