From 40fb10d25a1b4c8c96deb6ca499d21b174492748 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 30 Oct 2019 17:23:02 -0400 Subject: [PATCH] don't do work for stale requests --- web.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web.go b/web.go index 470dfd8..c836dcc 100644 --- a/web.go +++ b/web.go @@ -1071,7 +1071,7 @@ func zonkit(w http.ResponseWriter, r *http.Request) { 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 @@ func zonkit(w http.ResponseWriter, r *http.Request) { 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)