Skip to content

Commit 98e99fd

Browse files
committed
fix(model-server-lib): exclude nodes that fail to serialize
The client is able to handle non-loaded nodes.
1 parent 5139d27 commit 98e99fd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

model-server-lib/src/main/kotlin/org/modelix/model/server/light/LightModelServer.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ import io.ktor.server.plugins.cors.routing.*
2424
import io.ktor.server.routing.*
2525
import io.ktor.server.websocket.*
2626
import io.ktor.websocket.*
27-
import kotlinx.coroutines.Dispatchers
28-
import kotlinx.coroutines.launch
29-
import kotlinx.coroutines.runBlocking
30-
import kotlinx.coroutines.withContext
31-
import kotlinx.coroutines.withTimeout
27+
import kotlinx.coroutines.*
3228
import org.modelix.model.api.ConceptReference
3329
import org.modelix.model.api.IConceptReference
3430
import org.modelix.model.api.INode
@@ -191,7 +187,7 @@ class LightModelServer(val port: Int, val rootNode: INode, val ignoredRoles: Set
191187
fun createUpdate(): VersionData {
192188
val nodesToUpdate: MutableSet<INode> = HashSet()
193189
queryExecutor.update(query) { nodesToUpdate += it }
194-
val nodeDataList = nodesToUpdate.map { it.toData() }
190+
val nodeDataList = nodesToUpdate.mapNotNull { try { it.toData() } catch (ex: Exception) { null } }
195191
return VersionData(
196192
repositoryId = null,
197193
versionHash = null,

0 commit comments

Comments
 (0)