don't do work for stale requests
Ted Unangst tedu@tedunangst.com
Wed, 30 Oct 2019 17:23:02 -0400
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
web.go
→
web.go
@@ -1071,7 +1071,7 @@ defer oldjonks.Flush()
if wherefore == "ack" { xonk := getxonk(userinfo.UserID, what) - if xonk != nil { + if xonk != nil && !xonk.IsAcked() { _, err := stmtUpdateFlags.Exec(flagIsAcked, xonk.ID) if err != nil { log.Printf("error acking: %s", err)@@ -1083,7 +1083,7 @@ }
if wherefore == "deack" { xonk := getxonk(userinfo.UserID, what) - if xonk != nil { + if xonk != nil && xonk.IsAcked() { _, err := stmtClearFlags.Exec(flagIsAcked, xonk.ID) if err != nil { log.Printf("error deacking: %s", err)