protected class ThumbFetcher implements Runnable {
@Override
@SuppressWarnings("InfiniteLoopStatement")
public void run() {
while(true) {
MediaPost mediaPrevPost;
try {
mediaPrevPost = mediaPreviewUpdates.take();
} catch(InterruptedException e) { continue; }
try {
mediaLocalBoard.insertMediaPreview(mediaPrevPost, sourceBoard);
} catch(ContentGetException e) {
debug(ERROR, "Couldn't fetch preview of post " +
mediaPrevPost.getNum() + ": " + e.getMessage());
} catch(ContentStoreException e) {
debug(ERROR, "Couldn't save preview of post " +
mediaPrevPost.getNum() + ": " + e.getMessage());
}
}
}