X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-replicated;fp=ud-replicated;h=bb4fa37884f0899f55f7994d2882936bcf5a2795;hb=3f6b23ba5bdc2a7ce53fdac291bc85843bc8e84f;hp=1e19ef4ac0b14470f5d2c19de616391a34e52d33;hpb=8336d589b93d805e4b294b5e41154b0759f49881;p=mirror%2Fuserdir-ldap.git 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)