mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Various other refactoring
This commit is contained in:
parent
8f40e8fd5e
commit
48322bc2b2
12 changed files with 25 additions and 16 deletions
|
@ -27,7 +27,7 @@ func SetupConsumerProducer(cfg *config.JetStream) (sarama.Consumer, sarama.SyncP
|
|||
ServerName: "monolith",
|
||||
DontListen: true,
|
||||
JetStream: true,
|
||||
StoreDir: string(cfg.Matrix.ServerName),
|
||||
StoreDir: string(cfg.Matrix.JetStream.StoragePath),
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@ -76,6 +76,12 @@ func setupNATS(cfg *config.JetStream, nc *natsclient.Conn) (sarama.Consumer, sar
|
|||
stream.Name = cfg.TopicFor(stream.Name)
|
||||
stream.Subjects = []string{stream.Name}
|
||||
|
||||
// If we're trying to keep everything in memory (e.g. unit tests)
|
||||
// then overwrite the storage policy.
|
||||
if cfg.InMemory {
|
||||
stream.Storage = nats.MemoryStorage
|
||||
}
|
||||
|
||||
if _, err = s.AddStream(stream); err != nil {
|
||||
logrus.WithError(err).WithField("stream", stream.Name).Fatal("Unable to add stream")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue