mirror of
https://github.com/HexCardGames/HexDeck.git
synced 2025-09-04 02:48:39 +02:00
fix(backend): make sure database connection was successful before continuing
This commit is contained in:
@ -22,7 +22,11 @@ func main() {
|
||||
slog.Error("MONGO_URI environment variable not set!")
|
||||
return
|
||||
}
|
||||
db.InitDB(mongoUri)
|
||||
ok := db.InitDB(mongoUri)
|
||||
if !ok {
|
||||
slog.Error("Initializing MongoDB database failed")
|
||||
return
|
||||
}
|
||||
game.LoadRooms()
|
||||
|
||||
roomTicker := time.NewTicker(1 * time.Second)
|
||||
|
Reference in New Issue
Block a user