Package growthbook.sdk.java.featurefetch
Class FeatureRefreshCacheFreshness
java.lang.Object
growthbook.sdk.java.featurefetch.FeatureRefreshCacheFreshness
Decides whether a non-forced feature refresh can skip the network request
because cached or in-memory feature data is still fresh enough.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanshouldSkipRefresh(boolean forceRefresh, Duration backgroundFetchInterval, LongSupplier lastSuccessfulFetchAtMillis, LongSupplier cacheLastUpdatedMillis, BooleanSupplier hasFeatureData, BooleanSupplier loadCachedFeatures) static longtimestampMillisOrUnknown(Long timestampMillis) Converts nullable cache timestamps into the primitive form used by the freshness check.
-
Method Details
-
shouldSkipRefresh
public static boolean shouldSkipRefresh(boolean forceRefresh, Duration backgroundFetchInterval, LongSupplier lastSuccessfulFetchAtMillis, LongSupplier cacheLastUpdatedMillis, BooleanSupplier hasFeatureData, BooleanSupplier loadCachedFeatures) -
timestampMillisOrUnknown
Converts nullable cache timestamps into the primitive form used by the freshness check.
-