|
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Component;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.PrintWriter;
|
|
import java.io.PrintWriter;
|
|
import java.io.StringWriter;
|
|
import java.io.StringWriter;
|
|
|
|
+import java.util.Date;
|
|
import java.util.concurrent.*;
|
|
import java.util.concurrent.*;
|
|
|
|
|
|
|
|
|
|
@@ -91,13 +92,18 @@ public class PanoConsumer {
|
|
// 超时回调
|
|
// 超时回调
|
|
Future<String> future = exec.submit(call);
|
|
Future<String> future = exec.submit(call);
|
|
try {
|
|
try {
|
|
- String obj = future.get(configConstant.queueTimeout, TimeUnit.MINUTES); //任务处理超时时间设为 3分钟
|
|
|
|
|
|
+ //任务处理超时时间设为 3分钟
|
|
|
|
+ String obj = future.get(configConstant.queueTimeout, TimeUnit.MINUTES);
|
|
entity.setStatus(3);
|
|
entity.setStatus(3);
|
|
// 上传切图
|
|
// 上传切图
|
|
uploadOssDir(entity);
|
|
uploadOssDir(entity);
|
|
log.info("任务成功返回: " + obj);
|
|
log.info("任务成功返回: " + obj);
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
+ log.error("其他异常");
|
|
|
|
+ StringWriter trace=new StringWriter();
|
|
|
|
+ log.error(trace.toString());
|
|
|
|
+ entity.setStatus(2);
|
|
} catch (ExecutionException e) {
|
|
} catch (ExecutionException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
StringWriter trace=new StringWriter();
|
|
StringWriter trace=new StringWriter();
|
|
@@ -116,6 +122,7 @@ public class PanoConsumer {
|
|
entity.setStatus(2);
|
|
entity.setStatus(2);
|
|
future.cancel(true);
|
|
future.cancel(true);
|
|
} finally {
|
|
} finally {
|
|
|
|
+ entity.setUpdateTime(new Date());
|
|
sceneService.update(entity);
|
|
sceneService.update(entity);
|
|
}
|
|
}
|
|
}
|
|
}
|