]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network/src/org/simantics/district/network/profile/ThrottledStyleBase.java
Elimination of compiler warnings.
[simantics/district.git] / org.simantics.district.network / src / org / simantics / district / network / profile / ThrottledStyleBase.java
index f8b817ae2811143b2f1c92c34d214fc5ea777e58..93af11c4fa633e73dbc8ca4e885fe2e4a45ad599 100644 (file)
@@ -38,7 +38,7 @@ public abstract class ThrottledStyleBase<Result> extends StyleBase<Optional<Resu
     private static final Logger LOGGER = LoggerFactory.getLogger(ThrottledStyleBase.class);
     private static final long DEFAULT_INTERVAL = 2000;
 
-    private long lastCalculateTimestamp = 0;
+    //private long lastCalculateTimestamp = 0;
     private AtomicLong interval = new AtomicLong(DEFAULT_INTERVAL);
     private Listener<Optional<Result>> resultListener;
 
@@ -74,12 +74,13 @@ public abstract class ThrottledStyleBase<Result> extends StyleBase<Optional<Resu
     @Override
     public final Optional<Result> calculateStyle(ReadGraph graph, Resource runtimeDiagram, Resource entry,
             Resource groupItem) throws DatabaseException {
-        long currentTimestamp = System.currentTimeMillis();
-        if (lastCalculateTimestamp > (currentTimestamp - interval.get())) {
-            LOGGER.debug("Throttling result calculation for {} {} {} {}", runtimeDiagram, entry, groupItem, interval.get());
-            return Optional.empty();
-        }
-        lastCalculateTimestamp = currentTimestamp;
+// Needs fixing - this will result registration of listeners for nothing in the cache
+//        long currentTimestamp = System.currentTimeMillis();
+//        if (lastCalculateTimestamp > (currentTimestamp - interval.get())) {
+//            LOGGER.debug("Throttling result calculation for {} {} {} {}", runtimeDiagram, entry, groupItem, interval.get());
+//            return Optional.empty();
+//        }
+//        lastCalculateTimestamp = currentTimestamp;
         // let's calculate
         return Optional.ofNullable(calculateThrottledStyle(graph, runtimeDiagram, entry, groupItem));
     }