fix: Failing unit tests in import service (#28338)

Co-authored-by: Nidhi <nidhi@appsmith.com>
This commit is contained in:
Nayan 2023-10-25 09:43:29 +06:00 committed by GitHub
parent 1ab5913e61
commit 8b75ac54f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -523,7 +523,14 @@ public class ImportApplicationServiceCEImpl implements ImportApplicationServiceC
// Start the stopwatch to log the execution time
Stopwatch stopwatch = new Stopwatch(AnalyticsEvents.IMPORT.getEventName());
final Mono<Application> importedApplicationMono = applicationSpecificImportedEntitiesMono
/*
Calling the workspaceMono first to avoid creating multiple mongo transactions.
If the first db call inside a transaction is a Flux, then there's a chance of creating multiple mongo
transactions which will lead to NoSuchTransaction exception.
*/
final Mono<Application> importedApplicationMono = workspaceMono
.then(applicationSpecificImportedEntitiesMono)
.then(getImportApplicationMono(
importedApplication, importingMetaDTO, mappedImportableResourcesDTO, currUserMono))
.cache();