Implemented flag for workers

This commit is contained in:
Kanahia 2024-07-22 16:23:22 +05:30
parent 7255c994a6
commit 368d3bbff0

View file

@ -107,7 +107,7 @@ class UploadClient @Inject constructor(
return Observable.just(StashUploadResult(StashUploadState.CANCELLED, null, "Upload cancelled")) return Observable.just(StashUploadResult(StashUploadState.CANCELLED, null, "Upload cancelled"))
} }
contributionDao.getContribution(contribution.pageId).state == Contribution.STATE_PAUSED -> { contributionDao.getContribution(contribution.pageId).state == Contribution.STATE_PAUSED -> {
Timber.tag("PRINT").d("Upload stash paused %s", contribution.pageId) Timber.d("Upload stash paused %s", contribution.pageId)
Observable.just(StashUploadResult(StashUploadState.PAUSED, null, null)) Observable.just(StashUploadResult(StashUploadState.PAUSED, null, null))
} }
failures.get() -> { failures.get() -> {
@ -272,7 +272,6 @@ private fun canProcess(
): Boolean { ): Boolean {
// As long as the contribution hasn't been paused and there are no errors, // As long as the contribution hasn't been paused and there are no errors,
// we can process the current chunk. // we can process the current chunk.
Timber.tag("PRINT").e("oyee" + contributionDao.getContribution(contribution.pageId).state)
return !(contributionDao.getContribution(contribution.pageId).state == Contribution.STATE_PAUSED return !(contributionDao.getContribution(contribution.pageId).state == Contribution.STATE_PAUSED
|| failures.get()) || failures.get())
} }