androidandroid-workmanager

How many times I can reschedule workers with WorkManager is there a quota for this


I'm using WorkManager to show to users some notifications in case of their long inactivity in the app. So basically I detect if user left the app(app went to background or destroyed) in this case I'm scheduling certain chain of workers which would show notifications. When user goes foreground I'm canceling these workers. It happens many times, so I'm wondering are there any restrictions, quotas of how many times I can reschedule.

To schedule I'm using these approach

workManager.beginUniqueWork(
            TAG_SOME_WORK,
            ExistingWorkPolicy.REPLACE,
            workRequests[0]
        ).then(workRequests.subList(1, workRequests.size))
            .enqueue()

To cancel:

WorkManager.getInstance(context).cancelUniqueWork(TAG_SOME_WORK)

Solution

  • There are no limits or quotas, but it would be practical to consider battery optimisation and system health