From 5321a61129dbcde7d62c8cf91150533f86ca2ea2 Mon Sep 17 00:00:00 2001 From: Joseph Ivie Date: Wed, 27 Mar 2024 13:47:31 -0600 Subject: [PATCH] Solving a few other problems --- .../kotlin/com/lightningkite/lightningserver/db/ModelCache.kt | 2 +- .../com/lightningkite/lightningserver/db/ModelRestEndpoints.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/commonMain/kotlin/com/lightningkite/lightningserver/db/ModelCache.kt b/client/src/commonMain/kotlin/com/lightningkite/lightningserver/db/ModelCache.kt index 194795f3..471cc8e4 100644 --- a/client/src/commonMain/kotlin/com/lightningkite/lightningserver/db/ModelCache.kt +++ b/client/src/commonMain/kotlin/com/lightningkite/lightningserver/db/ModelCache.kt @@ -277,7 +277,7 @@ class ModelCache, ID : Comparable>( override fun get(id: ID): WritableModel = cache.getOrPut(id) { WritableModelImpl(id) } - override suspend fun watch(id: ID): WritableModel { + override fun watch(id: ID): WritableModel { val original = cache.getOrPut(id) { WritableModelImpl(id) } return object : WritableModel by original { override fun addListener(listener: () -> Unit): () -> Unit { diff --git a/client/src/commonMain/kotlin/com/lightningkite/lightningserver/db/ModelRestEndpoints.kt b/client/src/commonMain/kotlin/com/lightningkite/lightningserver/db/ModelRestEndpoints.kt index 1ef3fb38..e1569645 100644 --- a/client/src/commonMain/kotlin/com/lightningkite/lightningserver/db/ModelRestEndpoints.kt +++ b/client/src/commonMain/kotlin/com/lightningkite/lightningserver/db/ModelRestEndpoints.kt @@ -45,7 +45,7 @@ interface ModelCollection, ID : Comparable> { operator fun get(id: ID): WritableModel suspend fun query(query: Query): Readable> suspend fun watch(query: Query): Readable> - suspend fun watch(id: ID): WritableModel = get(id) + fun watch(id: ID): WritableModel = get(id) suspend fun insert(item: T): WritableModel suspend fun insert(item: List): List suspend fun upsert(item: T): WritableModel