超时 处理
This commit is contained in:
parent
e1d0e355a0
commit
0b3a80bce1
@ -179,7 +179,7 @@ public class Gb28181DownloadService {
|
|||||||
@SuppressWarnings({"UnstableApiUsage", "unchecked"})
|
@SuppressWarnings({"UnstableApiUsage", "unchecked"})
|
||||||
public void video(HttpServletRequest request, HttpServletResponse response, String deviceCode, Date startTime, Date endTime, Boolean fileHeader, Boolean useDownload) {
|
public void video(HttpServletRequest request, HttpServletResponse response, String deviceCode, Date startTime, Date endTime, Boolean fileHeader, Boolean useDownload) {
|
||||||
AsyncContext asyncContext = request.startAsync();
|
AsyncContext asyncContext = request.startAsync();
|
||||||
asyncContext.setTimeout(0);
|
asyncContext.setTimeout(DateUtil.between(startTime, DateUtil.offsetSecond(endTime, 30), DateUnit.MS));
|
||||||
asyncContext.start(()->{
|
asyncContext.start(()->{
|
||||||
DateTime start = DateUtil.date();
|
DateTime start = DateUtil.date();
|
||||||
HttpServletResponse asyncResponse = (HttpServletResponse)asyncContext.getResponse();
|
HttpServletResponse asyncResponse = (HttpServletResponse)asyncContext.getResponse();
|
||||||
|
Loading…
Reference in New Issue
Block a user