Adding timeout on execution of postgres and ms sql actions (#5922)

This commit is contained in:
Trisha Anand 2021-07-16 20:24:18 +05:30 committed by GitHub
parent 3f34ce08e3
commit ede0df21bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -14,8 +14,8 @@ import com.appsmith.external.models.DBAuth;
import com.appsmith.external.models.DatasourceConfiguration;
import com.appsmith.external.models.DatasourceTestResult;
import com.appsmith.external.models.Endpoint;
import com.appsmith.external.models.PsParameterDTO;
import com.appsmith.external.models.Property;
import com.appsmith.external.models.PsParameterDTO;
import com.appsmith.external.models.RequestParamDTO;
import com.appsmith.external.models.SSLDetails;
import com.appsmith.external.plugins.BasePlugin;
@ -45,6 +45,7 @@ import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
@ -333,6 +334,7 @@ public class MssqlPlugin extends BasePlugin {
result.setRequest(request);
return result;
})
.timeout(Duration.ofMillis(actionConfiguration.getTimeoutInMillisecond()))
.subscribeOn(scheduler);
}

View File

@ -49,6 +49,7 @@ import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
@ -452,6 +453,7 @@ public class PostgresPlugin extends BasePlugin {
result.setRequest(request);
return result;
})
.timeout(Duration.ofMillis(actionConfiguration.getTimeoutInMillisecond()))
.subscribeOn(scheduler);
}