Race detection fix

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2020-05-19 16:36:08 -07:00
parent 99d1e56aac
commit 476e339cf9
2 changed files with 2 additions and 1 deletions

View File

@@ -695,7 +695,9 @@ func (o *Consumer) readStoredState() error {
// Setup tracking timer if we have restored pending.
if len(o.pending) > 0 && o.ptmr == nil {
o.mu.Lock()
o.ptmr = time.AfterFunc(o.config.AckWait, o.checkPending)
o.mu.Unlock()
}
return err
}

View File

@@ -546,7 +546,6 @@ func (a *Account) EnableJetStream(limits *JetStreamAccountLimits) error {
if !cfg.Created.IsZero() {
obs.setCreated(cfg.Created)
}
if err := obs.readStoredState(); err != nil {
s.Warnf(" Error restoring Consumer state: %v", err)
}