mutex to preserve the integrity of some seriously important data

This commit is contained in:
Ted Unangst 2021-02-09 18:48:36 -05:00
parent 715e79a5b4
commit 13d6bc9a81

View file

@ -26,6 +26,7 @@ import (
"sort"
"strconv"
"strings"
"sync"
"time"
"humungus.tedunangst.com/r/webs/cache"
@ -804,7 +805,11 @@ func saveextras(tx *sql.Tx, h *Honk) error {
return nil
}
var baxonker sync.Mutex
func addreaction(user *WhatAbout, xid string, who, react string) {
baxonker.Lock()
defer baxonker.Unlock()
h := getxonk(user.ID, xid)
if h == nil {
return