From f23c68f168906c620627319b58f3e45b11c91a17 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 7 Jun 2017 12:50:38 -0400 Subject: [PATCH] mgr/dashboard: fix error handling in remote_view_cache Signed-off-by: John Spray --- src/pybind/mgr/dashboard/remote_view_cache.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pybind/mgr/dashboard/remote_view_cache.py b/src/pybind/mgr/dashboard/remote_view_cache.py index 07858ab4ed8..294975d762c 100644 --- a/src/pybind/mgr/dashboard/remote_view_cache.py +++ b/src/pybind/mgr/dashboard/remote_view_cache.py @@ -22,13 +22,12 @@ class GetterThread(Thread): self._view.value = None self._view.value_when = None self._view.getter_thread = None - self.event.set() - - with self._view.lock: - self._view.latency = t1 - t0 - self._view.value = val - self._view.value_when = datetime.datetime.now() - self._view.getter_thread = None + else: + with self._view.lock: + self._view.latency = t1 - t0 + self._view.value = val + self._view.value_when = datetime.datetime.now() + self._view.getter_thread = None self.event.set() @@ -133,4 +132,4 @@ class RemoteViewCache(object): pass def _get(self): - raise NotImplementedError() \ No newline at end of file + raise NotImplementedError()