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;
@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));
}