mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-30 21:12:45 +00:00
One NATS instance per BaseDendrite
(#2438)
* One NATS instance per `BaseDendrite` * Fix roomserver
This commit is contained in:
parent
79e2fbc663
commit
09d754cfbf
11 changed files with 49 additions and 37 deletions
18
test/base.go
Normal file
18
test/base.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package test
|
||||
|
||||
import (
|
||||
"github.com/matrix-org/dendrite/setup/base"
|
||||
"github.com/matrix-org/dendrite/setup/config"
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
func Base(cfg *config.Dendrite) (*base.BaseDendrite, nats.JetStreamContext, *nats.Conn) {
|
||||
if cfg == nil {
|
||||
cfg = &config.Dendrite{}
|
||||
cfg.Defaults(true)
|
||||
}
|
||||
cfg.Global.JetStream.InMemory = true
|
||||
base := base.NewBaseDendrite(cfg, "Tests")
|
||||
js, jc := base.NATS.Prepare(base.ProcessContext, &cfg.Global.JetStream)
|
||||
return base, js, jc
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue