all repos — honk @ 555041b498c239a731c861436e3820c48b86c0ed

my fork of honk

handle two more db error conditions
Ted Unangst tedu@tedunangst.com
Sat, 10 Aug 2019 19:15:49 -0400
commit

555041b498c239a731c861436e3820c48b86c0ed

parent

94c2a1e8319731d30a742a20af27f3d31743deee

1 files changed, 10 insertions(+), 2 deletions(-)

jump to
M deliverator.godeliverator.go

@@ -128,7 +128,11 @@ var doovers []Doover

for rows.Next() { var d Doover var dt string - rows.Scan(&d.ID, &dt) + err := rows.Scan(&d.ID, &dt) + if err != nil { + log.Printf("error scanning dooverid: %s", err) + continue + } d.When, _ = time.Parse(dbtimeformat, dt) doovers = append(doovers, d) }

@@ -141,7 +145,11 @@ var goarounds int

var username, rcpt string var msg []byte row := stmtLoadDoover.QueryRow(d.ID) - row.Scan(&goarounds, &username, &rcpt, &msg) + err := row.Scan(&goarounds, &username, &rcpt, &msg) + if err != nil { + log.Printf("error scanning doover: %s", err) + continue + } stmtZapDoover.Exec(d.ID) log.Printf("redeliverating %s try %d", rcpt, goarounds) deliverate(goarounds, username, rcpt, msg)