Created
March 29, 2013 06:25
-
-
Save westhood/5269090 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gevent.monkey | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| logger.info("Gevent monkey patch is applied") | |
| gevent.monkey.patch_all() | |
| # RLock of sentry log handler may be created before applying gevent monkey | |
| # patch, which will lead to a deadlock. Replace it with a gevent RLock | |
| for handler in logger.root.handlers: | |
| if handler.get_name() == "sentry": | |
| logger.info("Replace the RLock of sentry log handler to a gevent RLock") | |
| handler.createLock() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment