From c8e9dc9898f41de65132d4fc32d36abc293a964d Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Thu, 13 Jul 2023 22:28:09 +0200 Subject: [PATCH] fix(vertx): Increase timeout for git clone operation --- .../martinwitt/laughing_train/mining/MiningStartup.java | 2 +- .../laughing_train/mining/QodanaPeriodicMiner.java | 9 +++++++-- .../laughing_train/mining/SpoonPeriodicMiner.java | 9 +++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/MiningStartup.java b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/MiningStartup.java index 8e406eca7..a91cf0e8d 100644 --- a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/MiningStartup.java +++ b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/MiningStartup.java @@ -39,7 +39,7 @@ void startup(@Observes StartupEvent event) { }); vertx.setPeriodic(TimeUnit.MINUTES.toMillis(3), TimeUnit.MINUTES.toMillis(25), v -> vertx.eventBus() .publish("miner", new MineNextProject(QodanaPeriodicMiner.ANALYZER_NAME))); - vertx.setPeriodic(TimeUnit.MINUTES.toMillis(3), TimeUnit.MINUTES.toMillis(15), v -> vertx.eventBus() + vertx.setPeriodic(TimeUnit.MINUTES.toMillis(2), TimeUnit.MINUTES.toMillis(15), v -> vertx.eventBus() .publish("miner", new MineNextProject(SpoonPeriodicMiner.ANALYZER_NAME))); } } diff --git a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/QodanaPeriodicMiner.java b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/QodanaPeriodicMiner.java index abca9945e..ca7d1d212 100644 --- a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/QodanaPeriodicMiner.java +++ b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/QodanaPeriodicMiner.java @@ -14,9 +14,11 @@ import io.vertx.core.AbstractVerticle; import io.vertx.core.Future; import io.vertx.core.Vertx; +import io.vertx.core.eventbus.DeliveryOptions; import io.vertx.core.eventbus.Message; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; +import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; @Unremovable @@ -59,8 +61,11 @@ void mineWithQodana(MineNextProject event) { return; } logger.atInfo().log("Start mining with qodana"); - Future> request = - vertx.eventBus().request(ProjectSupplier.SERVICE_NAME, new GetProject(ANALYZER_NAME)); + Future> request = vertx.eventBus() + .request( + ProjectSupplier.SERVICE_NAME, + new GetProject(ANALYZER_NAME), + new DeliveryOptions().setSendTimeout(TimeUnit.MINUTES.toMillis(5))); request.onSuccess(v -> { if (v.body() instanceof ProjectResult.Success success) { var qodanaResult = analyzeProject(success); diff --git a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/SpoonPeriodicMiner.java b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/SpoonPeriodicMiner.java index 54cde4e1a..77dc89d1b 100644 --- a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/SpoonPeriodicMiner.java +++ b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/SpoonPeriodicMiner.java @@ -13,9 +13,11 @@ import io.vertx.core.AbstractVerticle; import io.vertx.core.Future; import io.vertx.core.Vertx; +import io.vertx.core.eventbus.DeliveryOptions; import io.vertx.core.eventbus.Message; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; +import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; @Unremovable @@ -58,8 +60,11 @@ void mineWithSpoon(MineNextProject event) { return; } logger.atInfo().log("Start mining with spoon"); - Future> request = - vertx.eventBus().request(ProjectSupplier.SERVICE_NAME, new GetProject(ANALYZER_NAME)); + Future> request = vertx.eventBus() + .request( + ProjectSupplier.SERVICE_NAME, + new GetProject(ANALYZER_NAME), + new DeliveryOptions().setSendTimeout(TimeUnit.MINUTES.toMillis(5))); request.onSuccess(v -> { if (v.body() instanceof ProjectResult.Success success) { var spoonResult = analyzeProjectWithSpoon(success);