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

Fix check uwsgi options #148

Merged
merged 1 commit into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ldclient/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ def check_uwsgi():
if 'uwsgi' in sys.modules:
# noinspection PyPackageRequirements,PyUnresolvedReferences
import uwsgi
if not hasattr(uwsgi, 'opt'):
# means that we are not running under uwsgi
return

if uwsgi.opt.get('enable-threads'):
return
if uwsgi.opt.get('threads') is not None and int(uwsgi.opt.get('threads')) > 1:
return
log.error("The LaunchDarkly client requires the 'enable-threads' or 'threads' option be passed to uWSGI. "
'To learn more, see http://docs.launchdarkly.com/v1.0/docs/python-sdk-reference#configuring-uwsgi')
'To learn more, see https://docs.launchdarkly.com/sdk/server-side/python#configuring-uwsgi')


class Event:
Expand Down