Fix map downloader
This commit is contained in:
parent
3dfcf8fecf
commit
078505633b
1 changed files with 2 additions and 1 deletions
|
@ -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$
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue