Skip to content
Snippets Groups Projects
Commit 34d08063 authored by Jonah Husson's avatar Jonah Husson
Browse files

fix initcreator test

parent 8df8ef75
Branches
Tags
2 merge requests!21Release,!18Batched notification
......@@ -7,8 +7,6 @@ import (
"sync/atomic"
)
type NotificationBuffer struct {
bufMap atomic.Value
counter *int64
......@@ -16,9 +14,13 @@ type NotificationBuffer struct {
func NewNotificationBuffer() *NotificationBuffer {
u := int64(0)
return &NotificationBuffer{
sm := sync.Map{}
nb := &NotificationBuffer{
counter: &u,
bufMap: atomic.Value{},
}
nb.bufMap.Store(&sm)
return nb
}
func (bnm *NotificationBuffer) Swap(maxNotifications uint) map[int64][]*pb.NotificationData {
......@@ -51,4 +53,3 @@ func (bnm *NotificationBuffer)Add(n *pb.NotificationData){
c := atomic.AddInt64(bnm.counter, 1)
bnm.bufMap.Load().(*sync.Map).Store(strconv.FormatInt(c, 16), n)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment