Merge 96b7371b40
into 78031b0ff2
This commit is contained in:
commit
02c4788943
|
@ -13,4 +13,4 @@ dev/
|
|||
todo
|
||||
deploy.secret.sh
|
||||
release_notes.txt
|
||||
out
|
||||
out/
|
||||
|
|
|
@ -279,11 +279,11 @@ class Database private constructor(var client: TelegramClient) {
|
|||
rs.next()
|
||||
val result = rs.getInt(1)
|
||||
rs.close()
|
||||
|
||||
return result
|
||||
} catch (e: SQLException) {
|
||||
throw RuntimeException("Could not get count of messages.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
|
|
|
@ -109,10 +109,10 @@ class DatabaseUpdates(protected var conn: Connection, protected var db: Database
|
|||
logger.debug("No update necessary.")
|
||||
}
|
||||
|
||||
stmt.close()
|
||||
} catch (e: SQLException) {
|
||||
throw RuntimeException(e)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun getUpdateToVersion(i: Int): DatabaseUpdate {
|
||||
|
@ -143,7 +143,6 @@ internal abstract class DatabaseUpdate(protected var conn: Connection, protected
|
|||
} catch (e: SQLException) {
|
||||
throw RuntimeException(e)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Throws(SQLException::class)
|
||||
|
@ -153,6 +152,8 @@ internal abstract class DatabaseUpdate(protected var conn: Connection, protected
|
|||
_doUpdate()
|
||||
logger.debug("Saving current database version to the db")
|
||||
stmt.executeUpdate("INSERT INTO database_versions (version) VALUES ($version)")
|
||||
|
||||
stmt.close()
|
||||
}
|
||||
|
||||
@Throws(SQLException::class)
|
||||
|
|
Loading…
Reference in New Issue