From 6dd6acbd445a9df7db7d0294076e5e9830e00b7d Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 14 Jun 2012 11:47:25 +0100 Subject: [PATCH] JAL-961 JAL-976 kill any existing AACon job if a new AACon worker is started due to an alignment edit or change in parameters --- src/jalview/ws/jws2/JabawsAlignCalcWorker.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java index eb898b3..df61495 100644 --- a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java +++ b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java @@ -82,7 +82,7 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker public void updateParameters(final WsParamSetI newpreset, final List newarguments) { - if (calcMan.isWorking(this)) + if (false) // || calcMan.isWorking(this)) { new Thread(new Runnable() { @@ -187,6 +187,28 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker { finished = true; } + if (calcMan.isPending(this) && this instanceof AAConsClient) + { + finished = true; + // cancel this job and yield to the new job + try + { + if (aaservice.cancelJob(rslt)) + { + System.err.println("Cancelled AACon job: " + rslt); + } + else + { + System.err.println("FAILED TO CANCELL AACon job: " + rslt); + } + + } catch (Exception x) + { + + } + + return; + } long cpos; ChunkHolder stats; do -- 1.7.10.2