TP-73994 | Added distinct until changed & removed deletion part (#11884)

This commit is contained in:
Ujjwal Kumar
2024-07-24 11:07:29 +05:30
committed by GitHub
parent d3aaec9b24
commit f03d630a00
2 changed files with 2 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ import com.navi.base.cache.model.NaviCacheEntity
import com.navi.base.cache.model.NaviCacheEntityDetails
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.map
@@ -93,7 +94,7 @@ class NaviCacheRepositoryImpl @Inject constructor(private val naviCacheDao: Navi
}
override fun getAsFlow(key: String): Flow<NaviCacheEntity?> {
return naviCacheDao.getAsFlow(key = key).map {
return naviCacheDao.getAsFlow(key = key).distinctUntilChanged().map {
if (
checkIfDBValueIsValidElseRemoveEntry(
naviCacheEntity = it,

View File

@@ -1018,10 +1018,6 @@ constructor(
naviPayAnalytics.onRewardsScratchCardCallbackForV2ExceptionOccurred(
exceptionMessage = e.message.orEmpty()
)
} finally {
naviCacheRepository.clear(
key = NAVI_PAY_REWARDS_SCRATCH_CARD_RESPONSE_CACHE_KEY
)
}
}
}