debug session

- MariadbSessionStorage not found error fix.
This commit is contained in:
dalbodeule 2024-08-10 17:25:52 +09:00
parent 2335a09391
commit a01827b055
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65

View File

@ -25,8 +25,15 @@ class MariadbSessionStorage: SessionStorage {
} }
override suspend fun write(id: String, value: String) { override suspend fun write(id: String, value: String) {
Session.findSingleByAndUpdate(SessionTable.key eq id) { val session = Session.find(SessionTable.key eq id).firstOrNull()
it.value = value
if(session == null) {
Session.new {
this.key = id
this.value = value
}
} else {
session.value = value
} }
} }
} }