1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Add missing Tx instrumentation

This commit is contained in:
Vladimir Mihailenco
2019-12-29 12:06:43 +02:00
parent 6c240ffc72
commit c0fcf85f12
5 changed files with 72 additions and 12 deletions

View File

@ -32,10 +32,16 @@ type hooks struct {
hooks []Hook
}
func (hs hooks) Lock() {
func (hs *hooks) Lock() {
hs.hooks = hs.hooks[:len(hs.hooks):len(hs.hooks)]
}
func (hs hooks) Clone() hooks {
clone := hs
clone.Lock()
return clone
}
func (hs *hooks) AddHook(hook Hook) {
hs.hooks = append(hs.hooks, hook)
}