Skip to content

Commit

Permalink
Fix check uwsgi options (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefreitas authored Nov 25, 2020
1 parent 20ccf15 commit e6219c9
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit e6219c9

Please sign in to comment.