forked from MirrorHub/mautrix-whatsapp
Fix --ignore-unsupported-database flag
This commit is contained in:
parent
63933d0c7e
commit
0c60516702
1 changed files with 5 additions and 4 deletions
9
main.go
9
main.go
|
@ -222,10 +222,10 @@ func (bridge *Bridge) Init() {
|
||||||
}
|
}
|
||||||
bridge.AS.Log = log.Sub("Matrix")
|
bridge.AS.Log = log.Sub("Matrix")
|
||||||
|
|
||||||
bridge.Log.Debugln("Initializing database")
|
bridge.Log.Debugln("Initializing database connection")
|
||||||
bridge.DB, err = database.New(bridge.Config.AppService.Database.Type, bridge.Config.AppService.Database.URI)
|
bridge.DB, err = database.New(bridge.Config.AppService.Database.Type, bridge.Config.AppService.Database.URI)
|
||||||
if err != nil && (err != upgrades.UnsupportedDatabaseVersion || !*ignoreUnsupportedDatabase) {
|
if err != nil {
|
||||||
bridge.Log.Fatalln("Failed to initialize database:", err)
|
bridge.Log.Fatalln("Failed to initialize database connection:", err)
|
||||||
os.Exit(14)
|
os.Exit(14)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,8 +260,9 @@ func (bridge *Bridge) Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bridge *Bridge) Start() {
|
func (bridge *Bridge) Start() {
|
||||||
|
bridge.Log.Debugln("Running database upgrades")
|
||||||
err := bridge.DB.Init()
|
err := bridge.DB.Init()
|
||||||
if err != nil {
|
if err != nil && (err != upgrades.UnsupportedDatabaseVersion || !*ignoreUnsupportedDatabase) {
|
||||||
bridge.Log.Fatalln("Failed to initialize database:", err)
|
bridge.Log.Fatalln("Failed to initialize database:", err)
|
||||||
os.Exit(15)
|
os.Exit(15)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue