title: WorkManager executing enqueueUniquePeriodicWork() multiple times at once?
body: <p>I'm new to this so do let me know if the question is badly worded! I have an Android app that needs to execute a task roughly every 15 minutes even if the phone is on lock. The context is:
  - Im targeting SDK 23 or higher
  - The task 1) takes the user's location 2) makes a call to an HTTPS API using OKHttpClient, then 3) sends the results to a Firestore database</p>
  
  <p>I'm using WorkManager to try to achieve this goal. However, the problem is every time it executes, it does so 8 - 9 times and it is very irregular in timing. I can see this from the Firestore entries and Logcat. </p>
  
  <p>Is WorkManager even the right way to go about this task? I am using</p>
  
  <pre><code>implementation "androidx.work:work-runtime:2.0.1"
  import androidx.work.PeriodicWorkRequest;
  import androidx.work.WorkManager;
  import androidx.work.ExistingPeriodicWorkPolicy;
  </code></pre>
  
  <p>I see others have had this issue: <a href="https://stackoverflow.com/questions/52351022/android-worker-execute-the-job-multiple-times">Android Worker execute the job multiple times</a></p>
  
  <pre><code>//In MainActivity.java: 
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          PeriodicWorkRequest periodicWorkRequest = new PeriodicWorkRequest.Builder(
                  PeriodicReadings.class, 15, TimeUnit.MINUTES).build();
  
          WorkManager.getInstance().enqueueUniquePeriodicWork("PWR", ExistingPeriodicWorkPolicy.REPLACE, periodicWorkRequest);
  
  //In PeriodicReadings.java:
  
      @NonNull
      @Override
      public Result doWork() {
          getReadings(); //work to be done 
          return Result.success();
      }
  </code></pre>
  
  <p>Every 15 minutes I expected a reading to appear in the Firestore database, but instead I see batches of 8 - 9 readings appear at irregular intervals varying every 15minutes - 2 hours.</p>
  
  <p>I have tried clean and rebuild, invalidating and restarting cache, and also reloading the app on the phone.</p>