diff --git a/entities/src/main/scala/com/devsisters/shardcake/Sharding.scala b/entities/src/main/scala/com/devsisters/shardcake/Sharding.scala index 4467a0c..70d2569 100644 --- a/entities/src/main/scala/com/devsisters/shardcake/Sharding.scala +++ b/entities/src/main/scala/com/devsisters/shardcake/Sharding.scala @@ -139,7 +139,7 @@ class Sharding private ( Metrics.shards .set(assignmentsOpt.count { case (_, podOpt) => podOpt.contains(address) }) .when(fromShardManager) *> - (if (fromShardManager) shardAssignments.update(map => if (map.isEmpty) assignments else map) + (if (fromShardManager) shardAssignments.set(assignments) else shardAssignments.update(map => // we keep self assignments (we don't override them with the new assignments