diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2020-02-29 11:42:35 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2020-02-29 11:42:35 +0100 |
commit | 852ca81bd49811a82274aa01ffd40d0c2dc5f773 (patch) | |
tree | c72bcada6e6cd36ec79b5ee29ffbc2b831c8cebb /vespa-maven-plugin | |
parent | 9ac4f3d18e1dbb11678b8d61fa50c9ad1cdf61d2 (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.java | 20 |
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"); |