Added check to prevent multiple uploads starting at once

This commit is contained in:
Kanahia 2024-08-10 19:41:02 +05:30
parent 34930f1fea
commit 9a4e87b4d4

View file

@ -173,7 +173,11 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
)!!
withContext(Dispatchers.IO) {
while (contributionDao.getContribution(statesToProcess)
.blockingGet().size > 0
.blockingGet().size > 0 && contributionDao.getContribution(
arrayListOf(
Contribution.STATE_IN_PROGRESS
)
).blockingGet().size == 0
) {
/*
queuedContributions receives the results from a one-shot query.