Configure NATS for dwingest

This commit is contained in:
Søren Rasmussen 2022-07-23 19:15:42 +02:00
parent 2a8dfe9bd9
commit 8733b1c1cf
3 changed files with 3 additions and 16 deletions

View file

@ -36,9 +36,6 @@ func mainLoop(ctx context.Context, wg *sync.WaitGroup, js nats.JetStream, config
// Controller
ctrl := controllers.NewChamberController("Chamber 1", *config)
// NATS
ingest := dwingest.NewDWIngest()
// Configuration reload
loadConfiguration := func() {
temperature.ConfigUpdate <- *config
@ -52,6 +49,9 @@ func mainLoop(ctx context.Context, wg *sync.WaitGroup, js nats.JetStream, config
loadConfiguration()
viper.WatchConfig()
// NATS
ingest := dwingest.NewDWIngest()
gpio, err := hw.NewGpio()
if err != nil {
hub.CaptureException(err)

View file

@ -41,18 +41,6 @@ func main() {
log.Fatal(err)
}
_, err = js.AddStream(&nats.StreamConfig{
Name: config.NATS.Stream,
Subjects: []string{
fmt.Sprintf("%v.*", config.NATS.Stream),
},
Replicas: 2,
Retention: nats.WorkQueuePolicy,
})
if err != nil {
log.Fatal(err)
}
// HTTP
mux := http.NewServeMux()
srv := &http.Server{

View file

@ -67,7 +67,6 @@ func (p *DWIngest) Run(ctx context.Context, wg *sync.WaitGroup, js nats.JetStrea
return
}
}
}