1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

gevent: set env var GEVENT_MONKEY_PATCH=1 in uwsgi.ini to enable monkey-patching explicitly in pywb.apps.wayback

This commit is contained in:
Ilya Kreymer 2016-03-20 23:18:11 -07:00
parent 63f44cbc26
commit 1a458d6b26
4 changed files with 9 additions and 8 deletions

View File

@ -1,11 +1,12 @@
pywb 0.11.4 changelist pywb 0.11.4 changelist
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
* wombat: overrides ``window.crypto.getRandomValues()`` to use predictable random for improved * wombat: overrides ``window.crypto.getRandomValues()`` to use predictable 'random' values for improved
replayability in many JS applications. replayability in many JS applications.
* fix gevent/uwsgi: add ``gevent.monkey.patch_all()`` to ``pywb.apps.wayback`` used by ``uwsgi.ini``. * fix gevent/uwsgi: run ``gevent.monkey.patch_all()`` explicitly when loading ``pywb.apps.wayback`` if ``GEVENT_MONKEY_PATCH=1`` env var is set
(Was relying on ``gevent-early-monkey-patch`` which is not yet available until uwsgi 2.1).
Enabled by default in ``uwsgi.ini``. (Was previously relying on ``gevent-early-monkey-patch`` which is not yet available until uwsgi 2.1 is released).
pywb 0.11.3 changelist pywb 0.11.3 changelist

View File

@ -1,3 +0,0 @@
def pytest_configure(config):
import sys
sys._called_from_test = True

View File

@ -1,9 +1,10 @@
import sys import os
if not hasattr(sys, '_called_from_test'): #pragma: no cover if os.environ.get('GEVENT_MONKEY_PATCH') == '1': #pragma: no cover
# Use gevent if available # Use gevent if available
try: try:
from gevent.monkey import patch_all; patch_all() from gevent.monkey import patch_all; patch_all()
print('gevent patched!')
except Exception as e: except Exception as e:
pass pass

View File

@ -16,6 +16,8 @@ gevent = 100
#Not available until uwsgi 2.1 #Not available until uwsgi 2.1
#monkey-patching manually in pywb.apps.wayback #monkey-patching manually in pywb.apps.wayback
#gevent-early-monkey-patch = #gevent-early-monkey-patch =
# for uwsgi<2.1, set env when using gevent
env = GEVENT_MONKEY_PATCH=1
# specify config file here # specify config file here
env = PYWB_CONFIG_FILE=config.yaml env = PYWB_CONFIG_FILE=config.yaml