-
Notifications
You must be signed in to change notification settings - Fork 303
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
Hot fix for failing video downloads on OSX. #4115
Hot fix for failing video downloads on OSX. #4115
Conversation
…the `multiprocessing` module. Set default value for the `DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP = False` at `kalite/settings/__init__.py` to fix crashes when `settings.DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP` is used in other Python codes.
@@ -46,6 +46,8 @@ def package_selected(package_name): | |||
RemovedInKALite_v015_Warning | |||
) | |||
|
|||
DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP = getattr(local_settings, "DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP", False) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Hi @benjaoming - yes we are still using But we are leaving I saw your merged PR already and will use that. Thanks. |
…ownloading-video-files-from-current-development-installs
…ownloading-video-files-from-current-development-installs
…ownloading-video-files-from-current-development-installs
…ownloading-video-files-from-current-development-installs
@@ -51,36 +50,6 @@ def call_command_with_output(cmd, *args, **kwargs): | |||
sys.exit = backups[2] | |||
|
|||
|
|||
def call_command_subprocess(cmd, *args, **kwargs): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…ver-for-downloading-video-files-from-current-development-installs Fix for PyRun: multiprocessing library does not exist, so opting for a different solution for calling external commands.
I think it's about time we merge this so we don't have stuff critical lying around unmerged just before launch! In a more general setting: Trying to import a module or an object from a module and catching But this |
Thanks @benjaoming - looking forward for the refactor at #4139 later. :) |
Hi @aronasorman, this PR does the following:
As per learningequality/ka-lite-installers#100 - PyRun doesn't include the
multiprocessing
module by default. So we check ifcall_command()
is being run inside PyRun and call another method that uses thesubprocess
module.If not running on Pyrun, we resume with current functionality that calls the
CommandProcess
class which uses themultiprocessing
module.To test this with Pyrun
setup.sh
of the OSX installers repo."<installers-working-dir>/installers/osx/temp/pyrun-2.7/bin/pip" install .
to install theka-lite-static
module."<working-dir>/installers/osx/temp/pyrun-2.7/bin/pip" freeze
- to see double-check thatka-lite-static
is installed.launchctl setenv KALITE_PYTHON "<bin/pyrun full path>"
. Example:launchctl setenv KALITE_PYTHON "/Users/cyril/w/fle/ka-lite/installers/osx/temp/pyrun-2.7/bin/pyrun"
KALITE_PYTHON
env var withenv | grep KA
.bin/kalite manage setup
command and test the device registration, video downloads, language downloads, and etc to see if they work.To test with the OSX default Python, just unset the
KALITE_PYTHON
withlaunchctl unsetenv KALITE_PYTHON
and restart the server.Tips
local_settings.py
for easier tracing.Other fix
This also sets the default value for the
DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP = False
atkalite/settings/__init__.py
to fix crashes whensettings.DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP
is used in other Python codes as per #4114. I had to do this to continue testing the fixes above.