aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-maven-plugin
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-02-29 11:42:35 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-02-29 11:42:35 +0100
commit852ca81bd49811a82274aa01ffd40d0c2dc5f773 (patch)
treec72bcada6e6cd36ec79b5ee29ffbc2b831c8cebb /vespa-maven-plugin
parent9ac4f3d18e1dbb11678b8d61fa50c9ad1cdf61d2 (diff)
Move deployment tailing logic to client
Diffstat (limited to 'vespa-maven-plugin')
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java20
1 files changed, 1 insertions, 19 deletions
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
index 851b1fa214c..cc714f38290 100644
--- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
@@ -60,25 +60,7 @@ public class DeployMojo extends AbstractVespaDeploymentMojo {
}
private void tailLogs(ApplicationId id, ZoneId zone, long run) throws MojoFailureException, MojoExecutionException {
- long last = -1;
- DeploymentLog log;
- while (true) {
- log = controller.deploymentLog(id, zone, run, last);
- for (DeploymentLog.Entry entry : log.entries())
- print(entry);
- last = log.last().orElse(last);
-
- if ( ! log.isActive())
- break;
-
- try {
- Thread.sleep(1000);
- }
- catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- break;
- }
- }
+ DeploymentLog log = controller.followDeploymentUntilDone(id, zone, run, this::print);
switch (log.status()) {
case success: return;
case error: throw new MojoExecutionException("Unexpected error during deployment; see log for details");