Skip to content

Commit

Permalink
Merge pull request #888 from MarathonLabs/fix/sharding-1
Browse files Browse the repository at this point in the history
fix(configuration): allow ANY_SUCCESS and count sharding strategy wit…
  • Loading branch information
Malinskiy authored Feb 1, 2024
2 parents c6465a8 + 8ad6eed commit d81a946
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ class LogicalConfigurationValidator : ConfigurationValidator {

when(configuration.executionStrategy.mode) {
ExecutionMode.ANY_SUCCESS -> {
if (configuration.shardingStrategy !is ShardingStrategyConfiguration.ParallelShardingStrategyConfiguration) {
throw ConfigurationException(
"Configuration is invalid: can't use complex sharding and any success execution strategy at the same time. Consult documentation for the any success execution logic"
)
when(configuration.shardingStrategy) {
is ShardingStrategyConfiguration.CountShardingStrategyConfiguration -> {
if (configuration.shardingStrategy.count != 1) {
throw ConfigurationException(
"Configuration is invalid: can't use complex sharding and any success execution strategy at the same time. Consult documentation for the any success execution logic"
)
}
}
else -> Unit
}
}
ExecutionMode.ALL_SUCCESS -> {
Expand Down

0 comments on commit d81a946

Please sign in to comment.