From a0d17151fe75c6255cab3ea504396be28b2bdd22 Mon Sep 17 00:00:00 2001 From: James Kafader Date: Tue, 16 May 2017 18:16:54 -0700 Subject: [PATCH] make sure this variable is actually defined --- doublethink/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doublethink/services.py b/doublethink/services.py index 2f4793c..43a9e80 100644 --- a/doublethink/services.py +++ b/doublethink/services.py @@ -220,10 +220,10 @@ class ServiceRegistry(object): the unique service, if there is one and it is healthy, otherwise None ''' + # use the same concept of 'now' for all queries + now = self.rr.now().run() if candidate is not None: candidate['id'] = role - # use the same concept of 'now' for all queries - now = rr.now().run() if not 'heartbeat_interval' in candidate: raise Exception(