aboutsummaryrefslogtreecommitdiff
path: root/roomserver
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-05-09 14:15:24 +0100
committerGitHub <noreply@github.com>2022-05-09 14:15:24 +0100
commit09d754cfbf9268044d0f59fbe509640b8d71e011 (patch)
tree23922c3b718c3317651fcd95da85f6f0765662f4 /roomserver
parent79e2fbc66368d8f4754b9fff8005d3e77969fcc4 (diff)
One NATS instance per `BaseDendrite` (#2438)
* One NATS instance per `BaseDendrite` * Fix roomserver
Diffstat (limited to 'roomserver')
-rw-r--r--roomserver/internal/input/input_test.go12
-rw-r--r--roomserver/roomserver.go2
2 files changed, 7 insertions, 7 deletions
diff --git a/roomserver/internal/input/input_test.go b/roomserver/internal/input/input_test.go
index 5d34842b..a95c1355 100644
--- a/roomserver/internal/input/input_test.go
+++ b/roomserver/internal/input/input_test.go
@@ -10,9 +10,9 @@ import (
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/roomserver/internal/input"
"github.com/matrix-org/dendrite/roomserver/storage"
+ "github.com/matrix-org/dendrite/setup/base"
"github.com/matrix-org/dendrite/setup/config"
- "github.com/matrix-org/dendrite/setup/jetstream"
- "github.com/matrix-org/dendrite/setup/process"
+ "github.com/matrix-org/dendrite/test"
"github.com/matrix-org/gomatrixserverlib"
"github.com/nats-io/nats.go"
)
@@ -21,11 +21,11 @@ var js nats.JetStreamContext
var jc *nats.Conn
func TestMain(m *testing.M) {
- var pc *process.ProcessContext
- pc, js, jc = jetstream.PrepareForTests()
+ var b *base.BaseDendrite
+ b, js, jc = test.Base(nil)
code := m.Run()
- pc.ShutdownDendrite()
- pc.WaitForComponentsToFinish()
+ b.ShutdownDendrite()
+ b.WaitForComponentsToFinish()
os.Exit(code)
}
diff --git a/roomserver/roomserver.go b/roomserver/roomserver.go
index 46261eb3..1480e894 100644
--- a/roomserver/roomserver.go
+++ b/roomserver/roomserver.go
@@ -50,7 +50,7 @@ func NewInternalAPI(
logrus.WithError(err).Panicf("failed to connect to room server db")
}
- js, nc := jetstream.Prepare(base.ProcessContext, &cfg.Matrix.JetStream)
+ js, nc := base.NATS.Prepare(base.ProcessContext, &cfg.Matrix.JetStream)
return internal.NewRoomserverAPI(
base.ProcessContext, cfg, roomserverDB, js, nc,