Skip to content

Commit 9438e8e

Browse files
committed
fix(bulk-model-sync-gradle): use longer HTTP request timeouts
Large amounts of data might take more time to process when importing into the model-server. Therefore, this commits increases the HTTP timeouts to avoid an import failure.
1 parent 30b59fc commit 9438e8e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bulk-model-sync-gradle/src/main/kotlin/org/modelix/model/sync/bulk/gradle/tasks/ImportIntoModelServer.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import org.modelix.model.sync.bulk.ModelImporter
4040
import org.modelix.model.sync.bulk.importFilesAsRootChildren
4141
import org.modelix.model.sync.bulk.isModuleIncluded
4242
import javax.inject.Inject
43+
import kotlin.time.Duration.Companion.minutes
4344

4445
abstract class ImportIntoModelServer @Inject constructor(of: ObjectFactory) : DefaultTask() {
4546

@@ -78,7 +79,12 @@ abstract class ImportIntoModelServer @Inject constructor(of: ObjectFactory) : De
7879
val repoId = RepositoryId(repositoryId.get())
7980

8081
val branchRef = ModelFacade.createBranchReference(repoId, branchName.get())
81-
val client = ModelClientV2.builder().url(url.get()).build()
82+
val client = ModelClientV2.builder()
83+
.url(url.get())
84+
// Processing large chunks of data on import might take some time. Therefore, extend the request timeout to
85+
// let the model-server do the import.
86+
.requestTimeout(5.minutes)
87+
.build()
8288
val files = inputDir.listFiles()?.filter {
8389
it.extension == "json" && isModuleIncluded(it.nameWithoutExtension, includedModules.get(), includedModulePrefixes.get())
8490
}

0 commit comments

Comments
 (0)