every database exec must have error checking
This commit is contained in:
parent
5b309bb846
commit
fbe47a0895
17
activity.go
17
activity.go
|
@ -230,13 +230,19 @@ func savexonk(user *WhatAbout, x *Honk) {
|
||||||
log.Printf("eradicating %s by %s", x.XID, x.Honker)
|
log.Printf("eradicating %s by %s", x.XID, x.Honker)
|
||||||
xonk := getxonk(user.ID, x.XID)
|
xonk := getxonk(user.ID, x.XID)
|
||||||
if xonk != nil {
|
if xonk != nil {
|
||||||
stmtZonkDonks.Exec(xonk.ID)
|
_, err := stmtZonkDonks.Exec(xonk.ID)
|
||||||
_, err := stmtZonkIt.Exec(user.ID, x.XID)
|
if err != nil {
|
||||||
|
log.Printf("error eradicating: %s", err)
|
||||||
|
}
|
||||||
|
_, err = stmtZonkIt.Exec(user.ID, x.XID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error eradicating: %s", err)
|
log.Printf("error eradicating: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stmtSaveZonker.Exec(user.ID, x.XID, "zonk")
|
_, err := stmtSaveZonker.Exec(user.ID, x.XID, "zonk")
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error eradicating: %s", err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Printf("saving xonk: %s", x.XID)
|
log.Printf("saving xonk: %s", x.XID)
|
||||||
|
@ -966,7 +972,10 @@ func gofish(name string) string {
|
||||||
rel, _ := l.GetString("rel")
|
rel, _ := l.GetString("rel")
|
||||||
t, _ := l.GetString("type")
|
t, _ := l.GetString("type")
|
||||||
if rel == "self" && friendorfoe(t) {
|
if rel == "self" && friendorfoe(t) {
|
||||||
stmtSaveXonker.Exec(name, href, "fishname")
|
_, err := stmtSaveXonker.Exec(name, href, "fishname")
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error saving fishname: %s", err)
|
||||||
|
}
|
||||||
handlock.Lock()
|
handlock.Lock()
|
||||||
handfull[name] = href
|
handfull[name] = href
|
||||||
handlock.Unlock()
|
handlock.Unlock()
|
||||||
|
|
|
@ -50,7 +50,10 @@ func sayitagain(goarounds int, username string, rcpt string, msg []byte) {
|
||||||
}
|
}
|
||||||
drift += time.Duration(notrand.Int63n(int64(drift / 10)))
|
drift += time.Duration(notrand.Int63n(int64(drift / 10)))
|
||||||
when := time.Now().UTC().Add(drift)
|
when := time.Now().UTC().Add(drift)
|
||||||
stmtAddDoover.Exec(when.Format(dbtimeformat), goarounds, username, rcpt, msg)
|
_, err := stmtAddDoover.Exec(when.Format(dbtimeformat), goarounds, username, rcpt, msg)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error saving doover: %s", err)
|
||||||
|
}
|
||||||
select {
|
select {
|
||||||
case pokechan <- 0:
|
case pokechan <- 0:
|
||||||
default:
|
default:
|
||||||
|
@ -150,7 +153,11 @@ func redeliverator() {
|
||||||
log.Printf("error scanning doover: %s", err)
|
log.Printf("error scanning doover: %s", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
stmtZapDoover.Exec(d.ID)
|
_, err = stmtZapDoover.Exec(d.ID)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error deleting doover: %s", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
log.Printf("redeliverating %s try %d", rcpt, goarounds)
|
log.Printf("redeliverating %s try %d", rcpt, goarounds)
|
||||||
deliverate(goarounds, username, rcpt, msg)
|
deliverate(goarounds, username, rcpt, msg)
|
||||||
} else if d.When.Before(nexttime) {
|
} else if d.When.Before(nexttime) {
|
||||||
|
|
10
honk.go
10
honk.go
|
@ -927,8 +927,14 @@ func zonkit(w http.ResponseWriter, r *http.Request) {
|
||||||
if wherefore == "zonk" {
|
if wherefore == "zonk" {
|
||||||
xonk := getxonk(userinfo.UserID, what)
|
xonk := getxonk(userinfo.UserID, what)
|
||||||
if xonk != nil {
|
if xonk != nil {
|
||||||
stmtZonkDonks.Exec(xonk.ID)
|
_, err := stmtZonkDonks.Exec(xonk.ID)
|
||||||
stmtZonkIt.Exec(userinfo.UserID, what)
|
if err != nil {
|
||||||
|
log.Printf("error zonking: %s", err)
|
||||||
|
}
|
||||||
|
_, err = stmtZonkIt.Exec(userinfo.UserID, what)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error zonking: %s", err)
|
||||||
|
}
|
||||||
if xonk.Whofore == 2 || xonk.Whofore == 3 {
|
if xonk.Whofore == 2 || xonk.Whofore == 3 {
|
||||||
zonk := Honk{
|
zonk := Honk{
|
||||||
What: "zonk",
|
What: "zonk",
|
||||||
|
|
Loading…
Reference in New Issue