mirror of
https://github.com/safing/portbase
synced 2025-09-13 00:30:09 +00:00
Make default api listen address configurable, fix race conditions
This commit is contained in:
parent
bbf06b31ac
commit
60dbbe55e9
3 changed files with 21 additions and 11 deletions
|
@ -367,7 +367,10 @@ func (api *DatabaseAPI) processSub(opID []byte, sub *database.Subscription) {
|
|||
continue
|
||||
}
|
||||
// TODO: use upd, new and delete msgTypes
|
||||
if r.Meta().IsDeleted() {
|
||||
r.Lock()
|
||||
isDeleted := r.Meta().IsDeleted()
|
||||
r.Unlock()
|
||||
if isDeleted {
|
||||
api.send(opID, dbMsgTypeDel, r.Key(), nil)
|
||||
} else {
|
||||
api.send(opID, dbMsgTypeUpd, r.Key(), data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue