Skip to content
This repository was archived by the owner on Apr 27, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ dev/
todo
deploy.secret.sh
release_notes.txt
out
out/
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -143,7 +143,6 @@ internal abstract class DatabaseUpdate(protected var conn: Connection, protected
} catch (e: SQLException) {
throw RuntimeException(e)
}

}

@Throws(SQLException::class)
Expand All @@ -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)
Expand Down