mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
refactor: optimize official processors
This commit is contained in:
parent
7616890050
commit
5ff56f8a41
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>powerjob</artifactId>
|
||||
<groupId>com.github.kfcfans</groupId>
|
||||
<version>2.0.0</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -95,10 +95,6 @@
|
||||
<pattern>org</pattern>
|
||||
<shadedPattern>shade.powerjob.org</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>javax</pattern>
|
||||
<shadedPattern>shade.powerjob.javax</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.google</pattern>
|
||||
<shadedPattern>shade.powerjob.com.google</shadedPattern>
|
||||
|
@ -26,21 +26,13 @@ public abstract class CommonBasicProcessor implements BasicProcessor {
|
||||
Stopwatch sw = Stopwatch.createStarted();
|
||||
ProcessResult result = process0(taskContext);
|
||||
omsLogger.info("[{}] execute succeed, using {}, result: {}", clzName, sw, result);
|
||||
return suit(result);
|
||||
return result;
|
||||
} catch (Throwable t) {
|
||||
omsLogger.error("[{}] execute failed!", clzName, t);
|
||||
return new ProcessResult(false, ExceptionUtils.getMessage(t));
|
||||
}
|
||||
}
|
||||
|
||||
private static ProcessResult suit(ProcessResult processResult) {
|
||||
if (processResult.getMsg() == null || processResult.getMsg().length() < 1024) {
|
||||
return processResult;
|
||||
}
|
||||
processResult.setMsg(processResult.getMsg().substring(0, 1024) + "...");
|
||||
return processResult;
|
||||
}
|
||||
|
||||
protected abstract ProcessResult process0(TaskContext taskContext) throws Exception;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user