37 |
@Override |
@Override |
38 |
public final void run() { |
public final void run() { |
39 |
|
|
40 |
|
if (this.state == TaskState.STATE_ABORTED) {//if this task as cancelled while still in queue |
41 |
|
return; |
42 |
|
} |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
TaskLogger.getInstance().reset(); |
TaskLogger.getInstance().reset(); |
47 |
|
|
48 |
TimingHelper timing = new TimingHelper(); |
TimingHelper timing = new TimingHelper(); |
62 |
|
|
63 |
|
|
64 |
} catch (Exception e) { |
} catch (Exception e) { |
65 |
|
logger.warning("Error during taskrun", e); |
66 |
this.errorMsg = e.getMessage(); |
this.errorMsg = e.getMessage(); |
|
e.printStackTrace(); |
|
67 |
this.state = TaskState.STATE_ABORTED; |
this.state = TaskState.STATE_ABORTED; |
68 |
} |
} |
69 |
|
|
72 |
logger.info("Done " + this.getDescription() + " " + timing.getElapsed() + "ms"); |
logger.info("Done " + this.getDescription() + " " + timing.getElapsed() + "ms"); |
73 |
|
|
74 |
logMessages = TaskLogger.getInstance().getBuffer(); |
logMessages = TaskLogger.getInstance().getBuffer(); |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
} |
} |
80 |
|
|
81 |
public final String getLog() { |
public final String getLog() { |