1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-18 01:50:50 +00:00

Fix crash when stulbe initialization fails

This commit is contained in:
Ash Keel 2021-05-18 15:53:17 +02:00
parent bfce1f6ce4
commit 785884551e
No known key found for this signature in database
GPG key ID: CF2CC050478BD7E5

11
main.go
View file

@ -128,12 +128,13 @@ func main() {
if err != nil {
log.WithError(err).Error("Stulbe initialization failed! Module was temporarely disabled")
moduleConfig.EnableStulbe = false
} else {
defer stulbeManager.Close()
go func() {
err := stulbeManager.ReceiveEvents()
stulbeLogger.WithError(err).Error("Stulbe subscription died unexpectedly!")
}()
}
defer stulbeManager.Close()
go func() {
err := stulbeManager.ReceiveEvents()
stulbeLogger.WithError(err).Error("Stulbe subscription died unexpectedly!")
}()
}
var loyaltyManager *loyalty.Manager