Ejemplo n.º 1
0
            except:
                logging.exception('Failed to update')
            time.sleep(60)
    finally:
        uwsgi.unlock(signum)


logging.basicConfig(level=logging.INFO)

logging.getLogger(
    'botocore.vendored.requests.packages.urllib3.connectionpool').setLevel(
        logging.WARNING)
app = connexion.App(__name__)
app.add_api('swagger.yaml')
application = app.app

try:
    import uwsgi
    for i in range(1, 1 + PARALLEL):
        signum = i
        uwsgi.register_signal(signum, "", run_update)
        uwsgi.add_timer(signum, 10)

    # initialization for /metrics endpoint (ZMON support)
    uwsgi_metrics.initialize()
except Exception as e:
    print(e)

if __name__ == '__main__':
    app.run(port=8080)
Ejemplo n.º 2
0
def setup():
    uwsgi_metrics.metrics.reset()
    uwsgi_metrics.initialize()
Ejemplo n.º 3
0
                                    # throttling
                                    time.sleep(60)
            except:
                logging.exception('Failed to update')
            time.sleep(60)
    finally:
        uwsgi.unlock(signum)


logging.basicConfig(level=logging.INFO)

logging.getLogger('botocore.vendored.requests.packages.urllib3.connectionpool').setLevel(logging.WARNING)
app = connexion.App(__name__)
app.add_api('swagger.yaml')
application = app.app

try:
    import uwsgi
    for i in range(1, 1 + PARALLEL):
        signum = i
        uwsgi.register_signal(signum, "", run_update)
        uwsgi.add_timer(signum, 10)

    # initialization for /metrics endpoint (ZMON support)
    uwsgi_metrics.initialize()
except Exception as e:
    print(e)

if __name__ == '__main__':
    app.run(port=8080)
Ejemplo n.º 4
0
def setup():
    uwsgi_metrics.metrics.reset()
    uwsgi_metrics.initialize()