mirror of https://github.com/tidwall/tile38.git
Verify hook names match for processing
This commit is contained in:
parent
b37033d281
commit
fd20190bff
|
@ -10,6 +10,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/tidwall/buntdb"
|
"github.com/tidwall/buntdb"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
"github.com/tidwall/resp"
|
"github.com/tidwall/resp"
|
||||||
"github.com/tidwall/tile38/internal/endpoint"
|
"github.com/tidwall/tile38/internal/endpoint"
|
||||||
"github.com/tidwall/tile38/internal/glob"
|
"github.com/tidwall/tile38/internal/glob"
|
||||||
|
@ -597,9 +598,12 @@ func (h *Hook) proc() (ok bool) {
|
||||||
err := tx.AscendGreaterOrEqual("hooks",
|
err := tx.AscendGreaterOrEqual("hooks",
|
||||||
h.query, func(key, val string) bool {
|
h.query, func(key, val string) bool {
|
||||||
if strings.HasPrefix(key, hookLogPrefix) {
|
if strings.HasPrefix(key, hookLogPrefix) {
|
||||||
|
// Verify this hooks name matches the one in the notif
|
||||||
|
if h.Name == gjson.Get(val, "hook").String() {
|
||||||
keys = append(keys, key)
|
keys = append(keys, key)
|
||||||
vals = append(vals, val)
|
vals = append(vals, val)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue