Send crash report synchronous to avoid lost of events

This commit is contained in:
Julien Duponchelle 2015-03-03 12:41:30 +01:00
parent 6208cb997d
commit 16dc0d1a8a
2 changed files with 4 additions and 6 deletions

View File

@ -18,6 +18,7 @@
import raven import raven
import json import json
import asyncio.futures import asyncio.futures
import asyncio
from .version import __version__ from .version import __version__
from .config import Config from .config import Config
@ -32,7 +33,7 @@ class CrashReport:
Report crash to a third party service Report crash to a third party service
""" """
DSN = "aiohttp+https://50af75d8641d4ea7a4ea6b38c7df6cf9:41d54936f8f14e558066262e2ec8bbeb@app.getsentry.com/38482" DSN = "sync+https://50af75d8641d4ea7a4ea6b38c7df6cf9:41d54936f8f14e558066262e2ec8bbeb@app.getsentry.com/38482"
_instance = None _instance = None
def __init__(self): def __init__(self):
@ -49,10 +50,7 @@ class CrashReport:
"url": request.path, "url": request.path,
"data": request.json, "data": request.json,
}) })
try:
self._client.captureException() self._client.captureException()
except asyncio.futures.TimeoutError:
pass # We don't care if we can send the bug report
@classmethod @classmethod
def instance(cls): def instance(cls):

View File

@ -130,7 +130,7 @@ class Server:
if modified > self._start_time: if modified > self._start_time:
log.debug("File {} has been modified".format(path)) log.debug("File {} has been modified".format(path))
asyncio.async(reload()) asyncio.async(reload())
self._loop.call_later(1, self._reload_hook) self._loop.call_later(1, self._reload_hook, handler)
def _create_ssl_context(self, server_config): def _create_ssl_context(self, server_config):