mutex to preserve the integrity of some seriously important data
This commit is contained in:
parent
715e79a5b4
commit
13d6bc9a81
1 changed files with 5 additions and 0 deletions
|
@ -26,6 +26,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"humungus.tedunangst.com/r/webs/cache"
|
"humungus.tedunangst.com/r/webs/cache"
|
||||||
|
@ -804,7 +805,11 @@ func saveextras(tx *sql.Tx, h *Honk) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var baxonker sync.Mutex
|
||||||
|
|
||||||
func addreaction(user *WhatAbout, xid string, who, react string) {
|
func addreaction(user *WhatAbout, xid string, who, react string) {
|
||||||
|
baxonker.Lock()
|
||||||
|
defer baxonker.Unlock()
|
||||||
h := getxonk(user.ID, xid)
|
h := getxonk(user.ID, xid)
|
||||||
if h == nil {
|
if h == nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue