From 3f6b23ba5bdc2a7ce53fdac291bc85843bc8e84f Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sat, 25 Jan 2014 14:40:40 +0000 Subject: [PATCH] a little defensiveness Signed-off-by: Stephen Gran --- ud-replicated | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ud-replicated b/ud-replicated index 1e19ef4..bb4fa37 100755 --- a/ud-replicated +++ b/ud-replicated @@ -76,8 +76,8 @@ last_run = 0 def do_replicate(message): global last_run last_update = int(time.time()) - LOG.debug("Got message at %s: %s" % (last_update, message['message'])) - if last_run > message.get('timestamp', 0): + LOG.debug("Got message at %s: %s" % (last_update, message.get('message', message))) + if last_run > message.get('timestamp', last_update): return command = ['/usr/bin/ud-replicate'] @@ -94,7 +94,7 @@ def do_replicate(message): LOG.debug('%s finished with ret: 0' % ' '.join(command)) finally: os.environ['TERM'] = old_term - last_run = int(time.time()) + last_run = last_update def main(): conn = Connection(conf=mq_conf) -- 2.20.1