mirror of
https://github.com/element-hq/dendrite.git
synced 2025-03-14 14:15:35 +00:00
Merge branch 'main' into msc3861
This commit is contained in:
commit
8d39801d3c
1 changed files with 8 additions and 5 deletions
|
@ -66,10 +66,8 @@ func (s *NATSInstance) Prepare(process *process.ProcessContext, cfg *config.JetS
|
|||
if !cfg.NoLog {
|
||||
s.SetLogger(NewLogAdapter(), opts.Debug, opts.Trace)
|
||||
}
|
||||
go func() {
|
||||
process.ComponentStarted()
|
||||
s.Start()
|
||||
}()
|
||||
process.ComponentStarted()
|
||||
go s.Start()
|
||||
go func() {
|
||||
<-process.WaitForShutdown()
|
||||
s.Shutdown()
|
||||
|
@ -77,7 +75,12 @@ func (s *NATSInstance) Prepare(process *process.ProcessContext, cfg *config.JetS
|
|||
process.ComponentFinished()
|
||||
}()
|
||||
if !s.ReadyForConnections(time.Second * 60) {
|
||||
logrus.Fatalln("NATS did not start in time")
|
||||
logrus.Fatalln("NATS did not start in time, shutting down")
|
||||
process.ShutdownDendrite()
|
||||
s.Shutdown()
|
||||
s.WaitForShutdown()
|
||||
process.ComponentFinished()
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue