From 16dc0d1a8a3d69233a704f9dc29ee5e3396219b7 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 3 Mar 2015 12:41:30 +0100 Subject: [PATCH] Send crash report synchronous to avoid lost of events --- gns3server/crash_report.py | 8 +++----- gns3server/server.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index e70a0e55..49f7f404 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -18,6 +18,7 @@ import raven import json import asyncio.futures +import asyncio from .version import __version__ from .config import Config @@ -32,7 +33,7 @@ class CrashReport: 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 def __init__(self): @@ -49,10 +50,7 @@ class CrashReport: "url": request.path, "data": request.json, }) - try: - self._client.captureException() - except asyncio.futures.TimeoutError: - pass # We don't care if we can send the bug report + self._client.captureException() @classmethod def instance(cls): diff --git a/gns3server/server.py b/gns3server/server.py index 69e95949..be677676 100644 --- a/gns3server/server.py +++ b/gns3server/server.py @@ -130,7 +130,7 @@ class Server: if modified > self._start_time: log.debug("File {} has been modified".format(path)) 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):