Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Kolibri server start to a separate persistent foreground service #52

Merged
merged 8 commits into from
Apr 5, 2020

Conversation

jamalex
Copy link
Member

@jamalex jamalex commented Apr 3, 2020

  • Some general refactors and cleanup -- mostly swamped by the subsequent changes in the switch to using a service.
  • Moved the server start code to a P4A service so that it's decoupled from the webview activity.
  • Followed this recipe to make the background service a foreground service, to prevent it from being killed.

This relies on the following changes to both pyeverywhere and kolibri:

(May be easiest to review main.py by just viewing the new version, rather than the diff)

create_premigrated_db:
pip install whl/*.whl
KOLIBRI_HOME=tmphome kolibri manage migrate
cp tmphome/db.sqlite3 src/db.sqlite3.empty
Copy link
Contributor

Choose a reason for hiding this comment

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

w00t!

Copy link
Member Author

Choose a reason for hiding this comment

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

Just wait... it escalated from there! Additional PR incoming.

Copy link
Contributor

@kollivier kollivier left a comment

Choose a reason for hiding this comment

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

Just flagging that I'm thinking of moving some of the Android code for creating the foreground service into pyeverywhere, and hopefully formalizing the concept of a service in the library. I think it's best to just focus on getting everything working first though, and then we can look at how best to design the longer-term approach. :)

@kollivier kollivier merged commit 0fe17ee into learningequality:develop Apr 5, 2020
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.

2 participants