Small changes to event ids, good approach though with separate lock on account

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2020-05-01 11:13:53 -07:00
parent 63845b8577
commit 17aca11002
3 changed files with 20 additions and 22 deletions

View File

@@ -211,7 +211,8 @@ type Server struct {
m sync.Map
}
eventids *nuid.NUID
// For eventIDs
eventIds *nuid.NUID
}
// Make sure all are 64bits for atomic use
@@ -277,17 +278,16 @@ func NewServer(opts *Options) (*Server, error) {
now := time.Now()
s := &Server{
kp: kp,
configFile: opts.ConfigFile,
info: info,
prand: rand.New(rand.NewSource(time.Now().UnixNano())),
opts: opts,
done: make(chan bool, 1),
start: now,
configTime: now,
gwLeafSubs: NewSublistWithCache(),
httpBasePath: httpBasePath,
eventids: nuid.New(),
kp: kp,
configFile: opts.ConfigFile,
info: info,
prand: rand.New(rand.NewSource(time.Now().UnixNano())),
opts: opts,
done: make(chan bool, 1),
start: now,
configTime: now,
gwLeafSubs: NewSublistWithCache(),
eventIds: nuid.New(),
}
// Trusted root operator keys.