def run_celery(): from celery.bin import worker app = create_app() init_celery(app, celery) runner = worker.worker(app=celery) config = {"loglevel": "INFO"} runner.run(**config)
def setUp(self): self.app = create_app() self.app.config.from_object('clustermgr.config.TestingConfig') self.client = self.app.test_client() with self.app.app_context(): db.create_all() appconf = AppConfiguration() appconf.gluu_version = '3.1.1' db.session.add(appconf) db.session.commit()
def create_cluster_app(info): return create_app()
import click from flask.cli import FlaskGroup from celery.bin import beat from celery.bin import worker from clustermgr.application import create_app, init_celery from clustermgr.extensions import celery from clustermgr.core.utils import logger from time import strftime from clustermgr.models import AppConfiguration from flask import request, render_template app = create_app() init_celery(app, celery) def create_cluster_app(info): return create_app() @click.group(cls=FlaskGroup, create_app=create_cluster_app) def cli(): """This is a management script for the wiki application""" pass def run_celerybeat(): """Function that starts the scheduled tasks in celery using celery.beat"""
def setUp(self): self.app = create_app() self.app.config.from_object('clustermgr.config.TestingConfig') self.client = self.app.test_client() with self.app.app_context(): db.create_all()