Commit 48061c77 by Aleksandr

Fixed passing the last rendered progress event

parent 165cbcb3
......@@ -17,7 +17,7 @@ class SendJobEventCollectorFlow @Inject constructor() {
.also { Timber.i("call: $result") }
suspend fun renderProgress(jobId: String, index: Int, total: Int) = emit(JobSenderResult.RenderProgress(jobId, index, total))
suspend fun uploadProgress(jobId: String, index: Int, total: Int) = emit(JobSenderResult.UploadProgress(jobId, index, total))
suspend fun uploadProgress(jobId: String?, index: Int, total: Int) = emit(JobSenderResult.UploadProgress(jobId, index, total))
suspend fun jobError(jobId: String, t: Throwable) = emit(JobSenderResult.Error(jobId, t))
suspend fun updateStatus(@JobStatus status: Int, vararg jobIds: String?) = emit(JobSenderResult.Statuses(status = status, jobIds = jobIds.toSet()))
......
......@@ -4,7 +4,7 @@ import com.isidroid.job.constant.JobStatus
sealed interface JobSenderResult {
data class RenderProgress(val jobId: String, val position: Int, val total: Int) : JobSenderResult
data class UploadProgress(val jobId: String, val position: Int, val total: Int) : JobSenderResult
data class UploadProgress(val jobId: String?, val position: Int, val total: Int) : JobSenderResult
data class Error(val jobId: String, val t: Throwable) : JobSenderResult
data class Statuses(@JobStatus val status: Int, val jobIds: Collection<String?>) : JobSenderResult
}
\ No newline at end of file
......@@ -82,6 +82,8 @@ internal class JobSendRepositoryImpl(
}
}
eventCollector.uploadProgress(null, total, total)
// update jobs
val successJobIds = sendJobResults.filter { it.value == 0 }.keys
printJobRepository.updateJobStatus(status = JobStatus.RENDER_UPLOAD, *successJobIds.toTypedArray())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment