This commit is contained in:
Vest 2018-04-04 19:20:04 +00:00 committed by GitHub
commit 02c4788943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

2
.gitignore vendored
View File

@ -13,4 +13,4 @@ dev/
todo
deploy.secret.sh
release_notes.txt
out
out/

View File

@ -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

View File

@ -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)