From: David ‘Bombe’ Roden Date: Sat, 9 Feb 2013 22:03:08 +0000 (+0100) Subject: Extract a local variable and use TimeUnit to increase readability. X-Git-Tag: 0.8.5^2~3^2~12 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2f08205222f4825d3f44908db57836ec405d8584;p=Sone.git Extract a local variable and use TimeUnit to increase readability. --- diff --git a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java index d525fc7..e92cf8e 100644 --- a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java +++ b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java @@ -21,6 +21,7 @@ import java.net.MalformedURLException; import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; @@ -229,7 +230,8 @@ public class FreenetInterface { } }; soneUskCallbacks.put(sone.getId(), uskCallback); - node.clientCore.uskManager.subscribe(USK.create(sone.getRequestUri()), uskCallback, (System.currentTimeMillis() - sone.getTime()) < 7 * 24 * 60 * 60 * 1000, (HighLevelSimpleClientImpl) client); + boolean runBackgroundFetch = (System.currentTimeMillis() - sone.getTime()) < TimeUnit.DAYS.toMillis(7); + node.clientCore.uskManager.subscribe(USK.create(sone.getRequestUri()), uskCallback, runBackgroundFetch, (HighLevelSimpleClientImpl) client); } catch (MalformedURLException mue1) { logger.log(Level.WARNING, String.format("Could not subscribe USK “%s”!", sone.getRequestUri()), mue1); }