Added the timeout to the DSN (thanks @mgedmin)

This commit is contained in:
Xavier Ordoquy 2013-08-10 02:40:39 +02:00
parent fa704c2455
commit 6c143500ab
2 changed files with 7 additions and 1 deletions

View File

@ -9,7 +9,7 @@ from __future__ import absolute_import
import logging
import sys
from raven.utils import compat
from raven.utils import compat, six
try:
# Google App Engine blacklists parts of the socket module, this will prevent
@ -183,6 +183,8 @@ class HTTPTransport(Transport):
self._parsed_url = parsed_url
self._url = parsed_url.geturl()
if isinstance(timeout, six.string_types):
timeout = int(timeout)
self.timeout = timeout
def send(self, data, headers):
@ -215,6 +217,8 @@ class HTTPTransport(Transport):
server = '%s://%s%s/api/%s/store/' % (
url.scheme, netloc, path, project)
if url.query:
server += '?%s' % url.query
scope.update({
'SENTRY_SERVERS': [server],
'SENTRY_PROJECT': project,

View File

@ -55,6 +55,8 @@ class TransportRegistry(object):
options = dict(q.split('=', 1) for q in parsed_url.query.split('&'))
else:
options = dict()
# Remove the options from the parsed_url
parsed_url = urlparse.urlparse(full_url.split('?')[0])
self._transports[full_url] = self._schemes[parsed_url.scheme](parsed_url, **options)
return self._transports[full_url]