Skip to content

Commit

Permalink
🐛 体育打卡请求忘记切线程
Browse files Browse the repository at this point in the history
  • Loading branch information
985892345 committed Aug 29, 2022
1 parent 6346732 commit bd5e1a3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import com.mredrock.cyxbs.lib.utils.extensions.*
import com.mredrock.cyxbs.lib.utils.network.mapOrThrowApiException
import com.mredrock.cyxbs.lib.utils.service.impl
import com.mredrock.cyxbs.sport.model.network.SportDetailApiService
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -85,6 +87,8 @@ class SportRepository : InitialService {
if (stuNum != null && sSportData == null) {
SportDetailApiService.INSTANCE
.getSportDetailData()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.mapOrThrowApiException()
.interceptExceptionByResult {
emitter.onSuccess(Result.failure(throwable))
Expand Down

0 comments on commit bd5e1a3

Please sign in to comment.