diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/ActionConstants.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/ActionConstants.java new file mode 100644 index 0000000000..61b02c6d33 --- /dev/null +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/ActionConstants.java @@ -0,0 +1,6 @@ +package com.appsmith.external.constants; + +public class ActionConstants { + // Default the action execution to 10s + public static final int DEFAULT_ACTION_EXECUTION_TIMEOUT_MS = 10000; +} diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ActionConfiguration.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ActionConfiguration.java index 75ee7dffac..c76af6d312 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ActionConfiguration.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ActionConfiguration.java @@ -10,6 +10,8 @@ import org.springframework.http.HttpMethod; import java.util.List; import java.util.Map; +import static com.appsmith.external.constants.ActionConstants.DEFAULT_ACTION_EXECUTION_TIMEOUT_MS; + @Getter @Setter @ToString @@ -25,7 +27,7 @@ public class ActionConfiguration { * action execution. */ - int timeoutInMillisecond = 10000; + Integer timeoutInMillisecond; // API fields String path; @@ -52,4 +54,9 @@ public class ActionConfiguration { * understands what the keys stand for. */ List pluginSpecifiedTemplates; + + public Integer getTimeoutInMillisecond() { + return (timeoutInMillisecond == null || timeoutInMillisecond <= 0) ? + DEFAULT_ACTION_EXECUTION_TIMEOUT_MS : timeoutInMillisecond; + } }