renaming and removal of unused code

This commit is contained in:
hrj 2020-07-16 17:23:48 +05:30
parent 1d7ef512bd
commit f08f6041ec
3 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,7 @@ class DBConn(){
lazy val userPstmt: PreparedStatement = con.prepareStatement("INSERT INTO users(email, hash) VALUES (?,?)")
lazy val validatePstmt: PreparedStatement = con.prepareStatement("SELECT hash FROM users WHERE hash = ? LIMIT 1")
def getConn(): Statement = {
def getStatement(): Statement = {
con.createStatement()
}

View File

@ -16,7 +16,7 @@ case class ProviderSecret(provider: String, secret: String)
class Captcha(throttle: Int) extends DBConn {
val stmt = getConn()
val stmt = getStatement()
stmt.execute("CREATE TABLE IF NOT EXISTS challenge(token varchar, id varchar, secret varchar, provider varchar, contentType varchar, image blob, solved boolean default False, PRIMARY KEY(token))")
stmt.execute("CREATE TABLE IF NOT EXISTS mapId(uuid varchar, token varchar, PRIMARY KEY(uuid), FOREIGN KEY(token) REFERENCES challenge(token))")
stmt.execute("CREATE TABLE IF NOT EXISTS users(email varchar, hash int)")

View File

@ -10,7 +10,6 @@ import lc.HTTPServer._
case class Secret(token: Int)
class RateLimiter extends DBConn {
val stmt = getConn()
val userLastActive = collection.mutable.Map[Int, Long]()
val userAllowance = collection.mutable.Map[Int, Double]()
val rate = 8.0