Skip to content

headlesstask wake-lock consumes battery #13720

Description

@atlanteh

I have a headless task that wakes up every 30 minutes. does some work for 1-2 seconds and finishes. However I see that the wake-lock is held much much longer than necessary. The battery is draining like crazy. I thought this might be something with my code, so I created an empty project with just my headless task code, but the wake-lock keeps draining the battery. I added logs and I see that the services is destroying after the task is done, so it's releasing the wake-lock acquired in the receiver. So either I'm doing something wrong, or the problem is in react-native.

I uploaded my demo example here:
https://github.com/atlanteh/headlesstask-battery-consumption-example

  • React Native version: 0.41.2
  • Platform: android
  • Development Operating System: windows

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions