Getting rid of unused TimeoutException
This commit is contained in:
parent
1e02c6b88b
commit
0adfb5b485
2 changed files with 5 additions and 7 deletions
|
|
@ -4,7 +4,6 @@ import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.concurrent.TimeoutException;
|
|
||||||
|
|
||||||
import javax.servlet.RequestDispatcher;
|
import javax.servlet.RequestDispatcher;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
|
@ -180,7 +179,7 @@ public class AlbumServlet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cimg == null) {
|
if (cimg == null) {
|
||||||
try {
|
// try {
|
||||||
cimg = pictureScaler.scalePicture(file, thumbnail, size);
|
cimg = pictureScaler.scalePicture(file, thumbnail, size);
|
||||||
imageCache.put(new Element(key, cimg));
|
imageCache.put(new Element(key, cimg));
|
||||||
long millisSinceLastFlush = System.currentTimeMillis() - lastCacheFlushTime;
|
long millisSinceLastFlush = System.currentTimeMillis() - lastCacheFlushTime;
|
||||||
|
|
@ -189,10 +188,10 @@ public class AlbumServlet
|
||||||
lastCacheFlushTime = System.currentTimeMillis();
|
lastCacheFlushTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
System.out.println(" " + key + " added to the cache with size " + cimg.bits.length + " -- now " + imageCache.getSize() + " entries");
|
System.out.println(" " + key + " added to the cache with size " + cimg.bits.length + " -- now " + imageCache.getSize() + " entries");
|
||||||
} catch (TimeoutException e) {
|
// } catch (TimeoutException e) {
|
||||||
res.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
|
// res.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
res.setStatus(HttpServletResponse.SC_OK);
|
res.setStatus(HttpServletResponse.SC_OK);
|
||||||
res.setDateHeader("Last-Modified", file.lastModified());
|
res.setDateHeader("Last-Modified", file.lastModified());
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.PriorityBlockingQueue;
|
import java.util.concurrent.PriorityBlockingQueue;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.imageio.ImageReadParam;
|
import javax.imageio.ImageReadParam;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue