TP-73994 | Added distinct until changed & removed deletion part (#11884)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -1018,10 +1018,6 @@ constructor(
|
||||
naviPayAnalytics.onRewardsScratchCardCallbackForV2ExceptionOccurred(
|
||||
exceptionMessage = e.message.orEmpty()
|
||||
)
|
||||
} finally {
|
||||
naviCacheRepository.clear(
|
||||
key = NAVI_PAY_REWARDS_SCRATCH_CARD_RESPONSE_CACHE_KEY
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user