2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-05 21:20:45 +00:00

Bug 1816433 - Reduce maybeFetchExperiments interval when using the preview collection

(cherry picked from commit 30ab88c935389eb37e31d257c3bbceff021f370b)
This commit is contained in:
James Hugman 2023-02-20 15:57:08 +00:00 committed by mergify[bot]
parent f2021a941c
commit 5a2da30134

View File

@ -102,8 +102,13 @@ fun NimbusInterface.maybeFetchExperiments(
feature: NimbusSystem = FxNimbus.features.nimbusSystem.value(),
currentTimeMillis: Long = System.currentTimeMillis(),
) {
val minimumPeriodMinutes = if (!context.settings().nimbusUsePreview) {
feature.refreshIntervalForeground
} else {
0
}
val lastFetchTimeMillis = context.settings().nimbusLastFetchTime
val minimumPeriodMinutes = feature.refreshIntervalForeground
val minimumPeriodMillis = minimumPeriodMinutes * Settings.ONE_MINUTE_MS
if (currentTimeMillis - lastFetchTimeMillis >= minimumPeriodMillis) {