From 08ad9080fbc0530ea855ac6deaf1a24dd098d441 Mon Sep 17 00:00:00 2001 From: shekhar16 Date: Fri, 28 Jul 2023 23:18:41 +0530 Subject: [PATCH] fix(jans-link): polling interval and time difference calculation #5667 (#5668) Signed-off-by: Mustafa Baser --- .../src/main/java/io/jans/link/timer/CacheRefreshTimer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jans-link/server/src/main/java/io/jans/link/timer/CacheRefreshTimer.java b/jans-link/server/src/main/java/io/jans/link/timer/CacheRefreshTimer.java index e6725de8620..d984cca1c4b 100644 --- a/jans-link/server/src/main/java/io/jans/link/timer/CacheRefreshTimer.java +++ b/jans-link/server/src/main/java/io/jans/link/timer/CacheRefreshTimer.java @@ -214,7 +214,7 @@ private boolean isStartCacheRefresh(AppConfiguration currentConfiguration) { return false; } - long poolingInterval = StringHelper.toInteger(currentConfiguration.getPollingInterval()) * 60 * 1000; + long poolingInterval = StringHelper.toInteger(currentConfiguration.getPollingInterval()); if (poolingInterval < 0) { return false; } @@ -263,6 +263,7 @@ private boolean isStartCacheRefresh(AppConfiguration currentConfiguration) { } long timeDiffrence = System.currentTimeMillis() - this.lastFinishedTime; + timeDiffrence = timeDiffrence/1000; return timeDiffrence >= poolingInterval; }