Don‘t download a Sone more than once.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 Oct 2010 05:31:27 +0000 (07:31 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 Oct 2010 05:31:27 +0000 (07:31 +0200)
src/main/java/net/pterodactylus/sone/core/SoneDownloader.java

index 4469d2f..34f48d9 100644 (file)
@@ -111,6 +111,9 @@ public class SoneDownloader extends AbstractService {
         *            The Sone to fetch
         */
        public void fetchSone(Sone sone) {
+               if (core.getSoneStatus(sone) == SoneStatus.downloading) {
+                       return;
+               }
                logger.log(Level.FINE, "Starting fetch for Sone “%s” from %s…", new Object[] { sone, sone.getRequestUri().setMetaString(new String[] { "sone.xml" }) });
                FreenetURI requestUri = sone.getRequestUri().setMetaString(new String[] { "sone.xml" });
                core.setSoneStatus(sone, SoneStatus.downloading);