From: David ‘Bombe’ Roden Date: Fri, 22 Oct 2010 05:31:27 +0000 (+0200) Subject: Don‘t download a Sone more than once. X-Git-Tag: 0.1-RC1~100 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=21504ae986215cd0371801a2d30b1b5d2a756238;p=Sone.git Don‘t download a Sone more than once. --- diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java index 4469d2f..34f48d9 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java @@ -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);