Skip to content

Commit

Permalink
Merge pull request #145 from learningequality/interpreter_shutdown
Browse files Browse the repository at this point in the history
Interpreter shutdown
  • Loading branch information
rtibbles authored Jul 25, 2023
2 parents 9c24f9c + f73619a commit 767bd68
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,4 @@ public void onCreate() {
new File(context.getApplicationInfo().nativeLibraryDir)
);
}
@Override
public void onDestroy() {
super.onDestroy();
// When the service exits, call System.exit to teardown the process.
System.exit(0);
}
}
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cython
cython~=0.29
virtualenv
git+https://github.com/learningequality/python-for-android@5621e3f7223fe73fdc3522874affa66a0c482f5e#egg=python-for-android
git+https://github.com/learningequality/python-for-android@6afd747999d5252839e79f498bd237743a1ca98b#egg=python-for-android
11 changes: 7 additions & 4 deletions src/taskworker.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import logging
from os import environ

import initialization # noqa: F401 keep this first, to ensure we're set up for other imports
from kolibri.main import initialize

logging.info("Starting Kolibri task worker")
import __main__

initialize(skip_update=True)
job_id = __main__.PYTHON_WORKER_ARGUMENT

logging.info("Starting Kolibri task worker, for job {}".format(job_id))

job_id = environ.get("PYTHON_WORKER_ARGUMENT", "")
initialize(skip_update=True)

# Import this after we have initialized Kolibri
from kolibri.core.tasks.worker import execute_job # noqa: E402

execute_job(job_id)

logging.info("Ending Kolibri task worker, for job {}".format(job_id))

0 comments on commit 767bd68

Please sign in to comment.