handle two more db error conditions

This commit is contained in:
Ted Unangst 2019-08-10 19:15:49 -04:00
parent c91fd71e1e
commit d6929a5644
1 changed files with 10 additions and 2 deletions

View File

@ -128,7 +128,11 @@ func redeliverator() {
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 @@ func redeliverator() {
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)