Skip to content

Commit

Permalink
release 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jneves committed Mar 16, 2018
1 parent a170f50 commit 2ecea4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
setup(
name = 'zappa_sentry',
packages = ['zappa_sentry'],
version = '0.2.0',
version = '0.2.1',
description = 'Easy integration with sentry for zappa apps',
author = 'João Miguel Neves',
author_email = 'joao@silvaneves.org',
url = 'https://github.com/jneves/zappa-sentry',
download_url = 'https://github.com/jneves/zappa-sentry/archive/0.2.0.tar.gz',
download_url = 'https://github.com/jneves/zappa-sentry/archive/0.2.1.tar.gz',
keywords = 'logging zappa sentry',
install_requires=[
'raven'
Expand Down
13 changes: 8 additions & 5 deletions zappa_sentry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
from raven.transport.http import HTTPTransport


raven_config = ConfigParser(os.environ)
_raven_client = None
# Cache this value and clients in the module to reduce overhead
this = sys.modules[__name__]

this.raven_config = ConfigParser(os.environ)
this._raven_client = None


def get_raven_client():
if not _raven_client:
_raven_client = Client(raven_config.get('DEFAULT', 'SENTRY_DSN'), transport=HTTPTransport)
return _raven_client
if not this._raven_client:
this._raven_client = Client(this.raven_config.get('DEFAULT', 'SENTRY_DSN'), transport=HTTPTransport)
return this._raven_client


def unhandled_exceptions(e, event, context):
Expand Down

0 comments on commit 2ecea4a

Please sign in to comment.