From 80720b941dbf0fc9c1f036f6a4efa5b3b40a0bdc Mon Sep 17 00:00:00 2001 From: James Procter Date: Fri, 7 Jul 2023 17:53:28 +0100 Subject: [PATCH] JAL-4217 JAL-629 built in 25s time out waiting for structure viewer to load data before attempting to grab an image. --- src/jalview/bin/Commands.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index d83afed..d7d1ea3 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -576,15 +576,21 @@ public class Commands } try { - while (sv.isBusy()) + long tries=1000; + while (sv.isBusy() && tries>0) { Thread.sleep(25); if (sv.isBusy()) { + tries--; Console.debug( "Waiting for viewer for " + structureFilepath); } } + if (tries==0 && sv.isBusy()) + { + Console.warn("Gave up waiting for structure viewer to load. Something may have gone wrong."); + } } catch (Exception x) { Console.warn("Exception whilst waiting for structure viewer "+structureFilepath,x); -- 1.7.10.2