Update linter
This commit is contained in:
@@ -102,7 +102,7 @@ private const val MILLISECONDS_IN_DAY = 86_400_000L
|
||||
fun Date.toRelativeString(
|
||||
context: Context,
|
||||
range: Int = 7,
|
||||
dateFormat: DateFormat = DateFormat.getDateInstance(DateFormat.SHORT)
|
||||
dateFormat: DateFormat = DateFormat.getDateInstance(DateFormat.SHORT),
|
||||
): String {
|
||||
if (range == 0) {
|
||||
return dateFormat.format(this)
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||
class RetryWithDelay(
|
||||
private val maxRetries: Int = 1,
|
||||
private val retryStrategy: (Int) -> Int = { 1000 },
|
||||
private val scheduler: Scheduler = Schedulers.computation()
|
||||
private val scheduler: Scheduler = Schedulers.computation(),
|
||||
) : Func1<Observable<out Throwable>, Observable<*>> {
|
||||
|
||||
private var retryCount = 0
|
||||
|
||||
@@ -41,11 +41,11 @@ private suspend fun <T> Observable<T>.awaitOne(): T = suspendCancellableCoroutin
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
/*
|
||||
* Rx1 observable throws NoSuchElementException if cancellation happened before
|
||||
* element emission. To mitigate this we try to atomically resume continuation with exception:
|
||||
* if resume failed, then we know that continuation successfully cancelled itself
|
||||
*/
|
||||
/*
|
||||
* Rx1 observable throws NoSuchElementException if cancellation happened before
|
||||
* element emission. To mitigate this we try to atomically resume continuation with exception:
|
||||
* if resume failed, then we know that continuation successfully cancelled itself
|
||||
*/
|
||||
val token = cont.tryResumeWithException(e)
|
||||
if (token != null) {
|
||||
cont.completeResume(token)
|
||||
|
||||
Reference in New Issue
Block a user