Fix map downloader

This commit is contained in:
Victor Shcherb 2014-10-13 00:58:01 +02:00
parent 3dfcf8fecf
commit 078505633b

View file

@ -149,6 +149,7 @@ public class MapTileDownloader {
while(!threadPoolExecutor.getQueue().isEmpty()){ while(!threadPoolExecutor.getQueue().isEmpty()){
threadPoolExecutor.getQueue().poll(); threadPoolExecutor.getQueue().poll();
} }
pendingToDownload.clear();
} }
public void requestToDownload(DownloadRequest request){ public void requestToDownload(DownloadRequest request){
@ -182,12 +183,12 @@ public class MapTileDownloader {
@Override @Override
public void run() { public void run() {
if (request != null && request.fileToSave != null && request.url != null) { if (request != null && request.fileToSave != null && request.url != null) {
pendingToDownload.remove(request.fileToSave);
if(currentlyDownloaded.contains(request.fileToSave)){ if(currentlyDownloaded.contains(request.fileToSave)){
return; return;
} }
currentlyDownloaded.add(request.fileToSave); currentlyDownloaded.add(request.fileToSave);
pendingToDownload.remove(request.fileToSave);
if(log.isDebugEnabled()){ if(log.isDebugEnabled()){
log.debug("Start downloading tile : " + request.url); //$NON-NLS-1$ log.debug("Start downloading tile : " + request.url); //$NON-NLS-1$
} }