Skip to content

Commit

Permalink
Initial values for dynamic settings
Browse files Browse the repository at this point in the history
Signed-off-by: Owais Kazi <[email protected]>
  • Loading branch information
owaiskazi19 committed Nov 7, 2023
1 parent 3d31567 commit 722f09d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public class FlowFrameworkSettings {
private FlowFrameworkSettings() {}

/** The upper limit of max workflows that can be created */
public static final int MAX_WORKFLOWS_LIMIT = 34;
public static final int MAX_WORKFLOWS_LIMIT = 1000;

/** This setting sets max workflows that can be created */
public static final Setting<Integer> MAX_WORKFLOWS = Setting.intSetting(
"plugins.flow_framework.max_workflows",
0,
100,
0,
MAX_WORKFLOWS_LIMIT,
Setting.Property.NodeScope,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.List;

import static org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS;
import static org.opensearch.flowframework.common.FlowFrameworkFeatureEnabledSetting.FLOW_FRAMEWORK_ENABLED;
import static org.opensearch.flowframework.common.FlowFrameworkSettings.FLOW_FRAMEWORK_ENABLED;
import static org.opensearch.flowframework.util.RestHandlerUtils.getSourceContext;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected void doExecute(Task task, WorkflowRequest request, ActionListener<Work
*/
protected void onSearchGlobalContext(SearchResponse response, ActionListener listener, Integer maxWorkflow) {
if (response.getHits().getTotalHits().value >= maxWorkflow) {
String errorMessage = "Maximum workflows limit reached" + maxWorkflow;
String errorMessage = "Maximum workflows limit reached " + maxWorkflow;
logger.error(errorMessage);
listener.onFailure(new FlowFrameworkException(errorMessage, RestStatus.BAD_REQUEST));

Check warning on line 202 in src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java#L200-L202

Added lines #L200 - L202 were not covered by tests
}
Expand Down

0 comments on commit 722f09d

Please sign in to comment.