mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
fix: NoClassDefFoundError of official-processor
This commit is contained in:
parent
f81b785c0f
commit
b690d9c594
@ -47,18 +47,22 @@ public abstract class AbstractScriptProcessor extends CommonBasicProcessor {
|
|||||||
StringBuilder inputSB = new StringBuilder();
|
StringBuilder inputSB = new StringBuilder();
|
||||||
StringBuilder errorSB = new StringBuilder();
|
StringBuilder errorSB = new StringBuilder();
|
||||||
|
|
||||||
pool.execute(() -> copyStream(process.getInputStream(), inputSB, omsLogger));
|
boolean success = true;
|
||||||
pool.execute(() -> copyStream(process.getErrorStream(), errorSB, omsLogger));
|
String result;
|
||||||
|
|
||||||
try {
|
try (InputStream is = process.getInputStream(); InputStream es = process.getErrorStream()) {
|
||||||
boolean success = process.waitFor() == 0;
|
|
||||||
String result = String.format("[INPUT]: %s;[ERROR]: %s", inputSB.toString(), errorSB.toString());
|
|
||||||
|
|
||||||
return new ProcessResult(success, result);
|
pool.execute(() -> copyStream(is, inputSB, omsLogger));
|
||||||
}catch (InterruptedException ie) {
|
pool.execute(() -> copyStream(es, errorSB, omsLogger));
|
||||||
|
|
||||||
|
success = process.waitFor() == 0;
|
||||||
|
|
||||||
|
} catch (InterruptedException ie) {
|
||||||
omsLogger.info("SYSTEM ===> ScriptProcessor has been interrupted");
|
omsLogger.info("SYSTEM ===> ScriptProcessor has been interrupted");
|
||||||
return new ProcessResult(false, "Interrupted");
|
} finally {
|
||||||
|
result = String.format("[INPUT]: %s;[ERROR]: %s", inputSB.toString(), errorSB.toString());
|
||||||
}
|
}
|
||||||
|
return new ProcessResult(success, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String prepareScriptFile(Long instanceId, String processorInfo) throws IOException {
|
private String prepareScriptFile(Long instanceId, String processorInfo) throws IOException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user