Skip to content
Snippets Groups Projects
Commit f2337c4d authored by gmantele's avatar gmantele
Browse files

[TAP] Fix a grave error: synchronous jobs were stopped much before the...

[TAP] Fix a grave error: synchronous jobs were stopped much before the specified execution duration ; the library was waiting N milliseconds, where N is the TAP execution duration always expressed in seconds.
parent 2a1e5786
No related branches found
No related tags found
No related merge requests found
...@@ -47,7 +47,7 @@ import uws.service.log.UWSLog.LogLevel; ...@@ -47,7 +47,7 @@ import uws.service.log.UWSLog.LogLevel;
* </p> * </p>
* *
* @author Gr&eacute;gory Mantelet (CDS;ARI) * @author Gr&eacute;gory Mantelet (CDS;ARI)
* @version 2.0 (09/2014) * @version 2.0 (11/2014)
*/ */
public class TAPSyncJob { public class TAPSyncJob {
...@@ -190,7 +190,7 @@ public class TAPSyncJob { ...@@ -190,7 +190,7 @@ public class TAPSyncJob {
boolean timeout = false; boolean timeout = false;
try{ try{
// wait the end: // wait the end:
thread.join(tapParams.getExecutionDuration()); thread.join(tapParams.getExecutionDuration() * 1000);
// if still alive after this duration, interrupt it: // if still alive after this duration, interrupt it:
if (thread.isAlive()){ if (thread.isAlive()){
timeout = true; timeout = true;
...@@ -198,7 +198,7 @@ public class TAPSyncJob { ...@@ -198,7 +198,7 @@ public class TAPSyncJob {
thread.join(waitForStop); thread.join(waitForStop);
} }
}catch(InterruptedException ie){ }catch(InterruptedException ie){
/* Having a such exception here, is not surprising, because we may have interrupt the thread! */ /* Having a such exception here, is not surprising, because we may have interrupted the thread! */
}finally{ }finally{
// Whatever the way the execution stops (normal, cancel or error), an execution report must be fulfilled: // Whatever the way the execution stops (normal, cancel or error), an execution report must be fulfilled:
execReport = thread.getExecutionReport(); execReport = thread.getExecutionReport();
......
...@@ -35,7 +35,7 @@ import uws.service.log.DefaultUWSLog; ...@@ -35,7 +35,7 @@ import uws.service.log.DefaultUWSLog;
* Default implementation of the {@link TAPLog} interface which lets logging any message about a TAP service. * Default implementation of the {@link TAPLog} interface which lets logging any message about a TAP service.
* *
* @author Gr&eacute;gory Mantelet (CDS;ARI) * @author Gr&eacute;gory Mantelet (CDS;ARI)
* @version 2.0 (09/2014) * @version 2.0 (11/2014)
* *
* @see DefaultUWSLog * @see DefaultUWSLog
*/ */
...@@ -126,7 +126,7 @@ public class DefaultTAPLog extends DefaultUWSLog implements TAPLog { ...@@ -126,7 +126,7 @@ public class DefaultTAPLog extends DefaultUWSLog implements TAPLog {
} }
// Log the message: // Log the message:
log(level, "TAP", event, jobId, message + msgAppend, error); log(level, "TAP", event, jobId, message + (msgAppend != null ? msgAppend : ""), error);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment