We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 390605f commit ab599b1Copy full SHA for ab599b1
entities/src/main/scala/com/devsisters/shardcake/Sharding.scala
@@ -47,9 +47,9 @@ class Sharding private (
47
isShuttingDownRef.set(true) *>
48
entityStates.get.flatMap(
49
ZIO.foreachDiscard(_) { case (name, entity) =>
50
- entity.entityManager.terminateAllEntities.catchAllCause(
51
- ZIO.logErrorCause(s"Error during stop of entity $name", _)
52
- )
+ entity.entityManager.terminateAllEntities.forkDaemon // run in a daemon fiber to make sure it doesn't get interrupted
+ .flatMap(_.join)
+ .catchAllCause(ZIO.logErrorCause(s"Error during stop of entity $name", _))
53
}
54
) *>
55
ZIO.logDebug(s"Unregistering pod $address to Shard Manager") *>
0 commit comments