xid failure should just panic

This commit is contained in:
Ted Unangst 2019-04-15 18:01:30 -04:00
parent a1b5912b95
commit fd632ab1d4
2 changed files with 3 additions and 8 deletions

8
fun.go
View File

@ -88,17 +88,15 @@ func xfiltrate() string {
continue
}
if err != sql.ErrNoRows {
log.Printf("err picking xid: %s", err)
return ""
log.Panicf("err picking xid: %s", err)
}
r = db.QueryRow("select fileid from files where name = ?", s)
r = db.QueryRow("select fileid from files where xid = ?", s)
err = r.Scan(&x)
if err == nil {
continue
}
if err != sql.ErrNoRows {
log.Printf("err picking xid: %s", err)
return ""
log.Panicf("err picking xid: %s", err)
}
return s
}

View File

@ -703,9 +703,6 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
dt := time.Now().UTC()
xid := xfiltrate()
if xid == "" {
return
}
what := "honk"
if rid != "" {
what = "tonk"