Skip to content

Commit

Permalink
feat(vertx): Use more robust time constrained mining instead of resul…
Browse files Browse the repository at this point in the history
…t based (#833)
  • Loading branch information
MartinWitt committed Jul 13, 2023
1 parent 7b89a83 commit 8aeb521
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import io.github.martinwitt.laughing_train.data.result.CodeAnalyzerResult;
import io.github.martinwitt.laughing_train.domain.entity.AnalyzerStatus;
import io.github.martinwitt.laughing_train.domain.entity.GitHubCommit;
import io.github.martinwitt.laughing_train.mining.requests.MineNextProject;
import io.github.martinwitt.laughing_train.mining.requests.StoreResults;
import io.github.martinwitt.laughing_train.persistence.repository.ProjectRepository;
import io.vertx.core.AbstractVerticle;
Expand Down Expand Up @@ -42,7 +41,6 @@ void persistResults(StoreResults storeResults) {
} else if (result instanceof CodeAnalyzerResult.Success success) {
logger.atInfo().log("Analyzer %s succeeded for project %s", SERVICE_NAME, project.name());
}
eventBus.publish("miner", new MineNextProject(storeResults.analyzerName()));
}

private AnalyzerStatus getAnalyzerStatus(CodeAnalyzerResult spoonResult, String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ void startup(@Observes StartupEvent event) {
System.out.println("Received message: " + v.toString());
v.next();
});
vertx.setTimer(TimeUnit.MINUTES.toMillis(3), v -> vertx.eventBus()
vertx.setPeriodic(TimeUnit.MINUTES.toMillis(3), TimeUnit.MINUTES.toMillis(25), v -> vertx.eventBus()
.publish("miner", new MineNextProject(QodanaPeriodicMiner.ANALYZER_NAME)));
vertx.setTimer(TimeUnit.MINUTES.toMillis(3), v -> vertx.eventBus()
vertx.setPeriodic(TimeUnit.MINUTES.toMillis(3), TimeUnit.MINUTES.toMillis(15), v -> vertx.eventBus()
.publish("miner", new MineNextProject(SpoonPeriodicMiner.ANALYZER_NAME)));
}
}

0 comments on commit 8aeb521

Please sign in to comment.