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