diff --git a/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/TaskworkerWorkerService.java b/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/TaskworkerWorkerService.java index 599ad417..d5cd3489 100644 --- a/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/TaskworkerWorkerService.java +++ b/python-for-android/dists/kolibri/src/main/java/org/learningequality/Kolibri/TaskworkerWorkerService.java @@ -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); - } } diff --git a/requirements.txt b/requirements.txt index 135fa73b..8ff666cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/src/taskworker.py b/src/taskworker.py index 2f978525..1aef7e0a 100644 --- a/src/taskworker.py +++ b/src/taskworker.py @@ -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))