Skip to content

Conversation

thomaszurkan-optimizely
Copy link
Contributor

Summary

  • Problems reported with EventScheduler scheduling too many jobs.

Issues

@thomaszurkan-optimizely thomaszurkan-optimizely changed the title potential fix for multi scheduling of event work (fix):potential fix for multi scheduling of event work Apr 22, 2019
Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, nice fix!

Copy link
Contributor

@jophde jophde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

job dedupe logic lgtm

// so it's important to only do this if we have stored events.
ServiceScheduler.startService(context, EventIntentService.JOB_ID, eventServiceIntent);
logger.info("Preemptively flushing events since wifi became available");
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not schedule on Android O?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding a comment. But, it is because in Android O and higher, we use the job scheduler and make the job persistent. this means that it will restart itself.

@thomaszurkan-optimizely thomaszurkan-optimizely merged commit e1be6e2 into master Apr 22, 2019
thomaszurkan-optimizely added a commit that referenced this pull request Apr 23, 2019
* potential fix for multi scheduling of event work

* add a comment why not restarting in event rescheduler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants