X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fbin%2FCommands.java;h=d7d1ea34fa42e9ad2d238a32c5650ad9ac2c3d9f;hb=eeed36339774143e579a97cdd8ba0763b020f3fd;hp=84effe016b529403f0be1db10d11e93fb669f20c;hpb=fb1fb73bd1e6b08de09932c98d39b847dda1cf9a;p=jalview.git diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 84effe0..d7d1ea3 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -576,18 +576,24 @@ public class Commands } try { + long tries=1000; + while (sv.isBusy() && tries>0) { - while (sv.isBusy()) - Thread.sleep(25); + 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); } Console.debug("Successfully opened viewer for "+structureFilepath); String structureImageFilename = ArgParser.getValueFromSubValOrArg(