Beispiel #1
0
def update(fqdn):
    logger.debug("Started job...")
    try:
        start_time = time.time()
        resolvers = Service.query_resolvers()
        services = Service.query_services()
        Haproxy().update(fqdn=fqdn, resolvers=resolvers, services=services)
        metrics.info('background-refresh.duration {}'.format(time.time() - start_time))
        metrics.info('active-thread-count {}'.format(threading.active_count()))
    finally:
        logger.debug("Finished job.")
Beispiel #2
0
def query_resolvers():
    return flask.jsonify({'resolvers': Service.query_resolvers()})