超时 处理

This commit is contained in:
shikong 2024-03-14 01:17:12 +08:00
parent e1d0e355a0
commit 0b3a80bce1

View File

@ -179,7 +179,7 @@ public class Gb28181DownloadService {
@SuppressWarnings({"UnstableApiUsage", "unchecked"})
public void video(HttpServletRequest request, HttpServletResponse response, String deviceCode, Date startTime, Date endTime, Boolean fileHeader, Boolean useDownload) {
AsyncContext asyncContext = request.startAsync();
asyncContext.setTimeout(0);
asyncContext.setTimeout(DateUtil.between(startTime, DateUtil.offsetSecond(endTime, 30), DateUnit.MS));
asyncContext.start(()->{
DateTime start = DateUtil.date();
HttpServletResponse asyncResponse = (HttpServletResponse)asyncContext.getResponse();