Skip to content

Commit

Permalink
Only complete the worker's scope after calling Worker.onStop
Browse files Browse the repository at this point in the history
  • Loading branch information
psteiger committed May 15, 2023
1 parent a815d85 commit e81100f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,14 @@ private fun <T : Comparable<T>> Worker.bind(
lifecycle
.takeWhile { it < lifecycleRange.endInclusive }
.onCompletion {
completable.onComplete()
bindAndReportWorkerInfo(
workerDurationListenerWeakRef,
WorkerEvent.STOP,
coroutineContext,
) {
onStop()
}
completable.onComplete()
}
.collect {
bindAndReportWorkerInfo(
Expand Down

0 comments on commit e81100f

Please sign in to comment.