fix job redirect cache location. #695

pull/705/head
hengyunabc 6 years ago
parent a4a2d08d4d
commit b48aa0c8e1

@ -42,6 +42,7 @@ public class RedirectHandler extends PlainTextHandler implements CloseFunction {
data = super.apply(data); data = super.apply(data);
if (out != null) { if (out != null) {
out.write(data); out.write(data);
out.flush();
} else { } else {
LogUtil.getResultLogger().info(data); LogUtil.getResultLogger().info(data);
} }

@ -33,6 +33,7 @@ import java.util.concurrent.atomic.AtomicInteger;
/** /**
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a> * @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
* @author hengyunabc 2019-05-14
*/ */
public class JobControllerImpl implements JobController { public class JobControllerImpl implements JobController {
@ -170,8 +171,8 @@ public class JobControllerImpl implements JobController {
String name = getRedirectFileName(tokens); String name = getRedirectFileName(tokens);
if (name == null) { if (name == null) {
// 如果没有指定重定向文件名那么重定向到以jobid命名的缓存中 // 如果没有指定重定向文件名那么重定向到以jobid命名的缓存中
name = Constants.PID + File.separator + jobId; name = Constants.CACHE_ROOT + File.separator + Constants.PID + File.separator + jobId;
cacheLocation = Constants.CACHE_ROOT + File.separator + name; cacheLocation = name;
if (getRedirectJobCount() == 8) { if (getRedirectJobCount() == 8) {
throw new IllegalStateException("The amount of async command that saving result to file can't > 8"); throw new IllegalStateException("The amount of async command that saving result to file can't > 8");

Loading…
Cancel
Save