Skip to content

Commit 8d39801

Browse files
authored
Merge branch 'main' into msc3861
2 parents 9ab9a8d + 06e25ca commit 8d39801

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

setup/jetstream/nats.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,21 @@ func (s *NATSInstance) Prepare(process *process.ProcessContext, cfg *config.JetS
6666
if !cfg.NoLog {
6767
s.SetLogger(NewLogAdapter(), opts.Debug, opts.Trace)
6868
}
69-
go func() {
70-
process.ComponentStarted()
71-
s.Start()
72-
}()
69+
process.ComponentStarted()
70+
go s.Start()
7371
go func() {
7472
<-process.WaitForShutdown()
7573
s.Shutdown()
7674
s.WaitForShutdown()
7775
process.ComponentFinished()
7876
}()
7977
if !s.ReadyForConnections(time.Second * 60) {
80-
logrus.Fatalln("NATS did not start in time")
78+
logrus.Fatalln("NATS did not start in time, shutting down")
79+
process.ShutdownDendrite()
80+
s.Shutdown()
81+
s.WaitForShutdown()
82+
process.ComponentFinished()
83+
return nil, nil
8184
}
8285
}
8386

0 commit comments

Comments
 (0)