Extract a local variable and use TimeUnit to increase readability.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 9 Feb 2013 22:03:08 +0000 (23:03 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 9 Feb 2013 22:03:08 +0000 (23:03 +0100)
src/main/java/net/pterodactylus/sone/core/FreenetInterface.java

index d525fc7..e92cf8e 100644 (file)
@@ -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);
                }