react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Server Taking too much load: How to control

Open premadinfotech opened this issue 3 years ago • 1 comments

We have integrated your library and set configuration but it is constantly recording the positions (when we move and the app is in the background). And we are saving these location coordinates in our database so it is this API is hitting very frequently which is exhausting our server resources.

Can you please suggest us what configurations we should use?

We want to record location and hitting the API (to save in our DB) on after 250 meter distance. We ahve set the distanceFilter param 250 but still it is executing constantly.

Please check the below mentioned configuration which we have used:

BackgroundGeolocation.ready({
      // Geolocation Config
      desiredAccuracy: 0,
      distanceFilter: 250,
      // Activity Recognition
      stopTimeout: 5,
      // Application config
      debug: false, 
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      stopOnTerminate: true, // <-- Allow the background-service to continue tracking when user closes the app.
      startOnBoot: true, // <-- Auto start tracking when device is powered-up.
      enableHeadless: true,
      locationUpdateInterval: 6000,
      useSignificantChangesOnly: true
    });

Please guide us.

Your Environment

  • Plugin version: 4.8.1
  • Platform: Android
  • OS version: 12
  • Device manufacturer / model: Vivo (IQOO Z5)
  • React Native version (react-native -v): 0.64.1
  • Plugin config: Mentioned above

Expected Behavior

Should record the locations only after some interval (like only after 250 meters).

Actual Behavior

Recorded locations constantly on each time when it changes.

premadinfotech avatar Sep 02 '22 11:09 premadinfotech

Show me your log file from .emailLog method.

christocracy avatar Sep 02 '22 12:09 christocracy

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jun 07 '24 01:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jun 22 '24 01:06 github-actions[bot]