Skip to content

Commit d81a946

Browse files
authored
Merge pull request #888 from MarathonLabs/fix/sharding-1
fix(configuration): allow ANY_SUCCESS and count sharding strategy wit…
2 parents c6465a8 + 8ad6eed commit d81a946

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

configuration/src/main/kotlin/com/malinskiy/marathon/config/LogicalConfigurationValidator.kt

+9-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@ class LogicalConfigurationValidator : ConfigurationValidator {
3636

3737
when(configuration.executionStrategy.mode) {
3838
ExecutionMode.ANY_SUCCESS -> {
39-
if (configuration.shardingStrategy !is ShardingStrategyConfiguration.ParallelShardingStrategyConfiguration) {
40-
throw ConfigurationException(
41-
"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"
42-
)
39+
when(configuration.shardingStrategy) {
40+
is ShardingStrategyConfiguration.CountShardingStrategyConfiguration -> {
41+
if (configuration.shardingStrategy.count != 1) {
42+
throw ConfigurationException(
43+
"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"
44+
)
45+
}
46+
}
47+
else -> Unit
4348
}
4449
}
4550
ExecutionMode.ALL_SUCCESS -> {

0 commit comments

Comments
 (0)