Esempio n. 1
0
def register_extensions(app):

    api.app = app
    # Overriding swaggerUI base path to serve content under a prefix
    apidoc.apidoc.static_url_path = '{}/swaggerui'.format(Config.BASE_PATH)
    api.init_app(app)

    cache.init_app(app)
    db.init_app(app)
    jwt.init_app(app)
    apm.init_app(app) if app.config['ELASTIC_ENABLED'] == '1' else None
    sched.init_app(app)

    CORS(app)
    Compress(app)

    if app.config.get('ENVIRONMENT_NAME') in ['test', 'prod']:
        if not app.debug or os.environ.get("WERKZEUG_RUN_MAIN") == 'true':
            sched.start()
            _schedule_NRIS_jobs(app)
            # This is here to prevent this from running in production until we are confident in the permit data.
            if app.config.get('ENVIRONMENT_NAME') == 'test':
                _schedule_ETL_jobs(app)

    return None
Esempio n. 2
0
def register_extensions(app):

    api.app = app
    api.init_app(app)
    cache.init_app(app)
    db.init_app(app)
    jwt.init_app(app)
    apm.init_app(app) if app.config['ELASTIC_ENABLED'] == '1' else None

    CORS(app)
    Compress(app)

    if app.config.get('ENVIRONMENT_NAME') == 'prod':
        sched.init_app(app)
        if not app.debug or os.environ.get("WERKZEUG_RUN_MAIN") == 'true':
            sched.start()
            _schedule_NRIS_jobs(app)

    return None
Esempio n. 3
0
def register_scheduled_jobs(app):
    if app.config.get('ENVIRONMENT_NAME') in ['test', 'prod']:
        if not app.debug or os.environ.get("WERKZEUG_RUN_MAIN") == 'true':
            sched.start()
            _schedule_IDIR_jobs(app)
            _schedule_ETL_jobs(app)
Esempio n. 4
0
def register_scheduled_jobs(app):
    if app.config['ENVIRONMENT_NAME'] in [
            'test', 'prod'
    ] and (not app.debug or os.environ.get("WERKZEUG_RUN_MAIN") == 'true'):
        sched.start()
        _schedule_nris_etl_jobs(app)