Signed-off-by: Stephen Gran <steve@lobefin.net>
syslog_handler.setFormatter(formatter)
LOG.addHandler(syslog_handler)
syslog_handler.setFormatter(formatter)
LOG.addHandler(syslog_handler)
def do_replicate(message):
def do_replicate(message):
- last_update = time.time()
- LOG.debug("Got message at %s" % last_update)
+ 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):
+ return
command = ['/usr/bin/ud-replicate']
if options.dryrun:
command = ['/usr/bin/ud-replicate']
if options.dryrun:
LOG.debug('%s finished with ret: 0' % ' '.join(command))
finally:
os.environ['TERM'] = old_term
LOG.debug('%s finished with ret: 0' % ' '.join(command))
finally:
os.environ['TERM'] = old_term
+ last_run = int(time.time())
def main():
conn = Connection(conf=mq_conf)
def main():
conn = Connection(conf=mq_conf)