I've created a Periodic Task that fetches data from my online database every ~8 hours. I must be sure that, when the App opens, it fetches data immediately using a Fetch method, because data must be accessed offline.
The problem comes when my method and the task executes at the same time, like when the task is enqueued for the first time. How to avoid this? So only one of the two runs at a time?.