Skip to content

Commit fe1f2eb

Browse files
authored
Merge pull request #39177 from appsmithorg/chore/cherry-pick-11Feb24
fix: Scheduling the heavy database ops on bounded elastic thread pool…
2 parents ea6ef42 + 48d0040 commit fe1f2eb

File tree

1 file changed

+7
-8
lines changed
  • app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins

1 file changed

+7
-8
lines changed

app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/MssqlPlugin.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,14 @@ private Set<String> populateHintMessages(List<String> columnNames) {
363363
@Override
364364
public Mono<HikariDataSource> datasourceCreate(DatasourceConfiguration datasourceConfiguration) {
365365
log.debug(Thread.currentThread().getName() + ": datasourceCreate() called for MSSQL plugin.");
366-
return connectionPoolConfig
367-
.getMaxConnectionPoolSize()
368-
.flatMap(maxPoolSize -> {
366+
return Mono.defer(
367+
() -> connectionPoolConfig.getMaxConnectionPoolSize().flatMap(maxPoolSize -> {
369368
return Mono.fromCallable(() -> {
370-
log.debug(Thread.currentThread().getName() + ": Connecting to SQL Server db");
371-
return createConnectionPool(datasourceConfiguration, maxPoolSize);
372-
});
373-
})
374-
.subscribeOn(scheduler);
369+
log.debug(Thread.currentThread().getName() + ": Connecting to SQL Server db");
370+
return createConnectionPool(datasourceConfiguration, maxPoolSize);
371+
})
372+
.subscribeOn(scheduler);
373+
}));
375374
}
376375

377376
@Override

0 commit comments

Comments
 (0)