def run(self): force_init_app() if ctx.es is None: ctx.log.error( "elasticsearch is not configured properly, giving up") return if self.args.action == 'index': self.reindex()
def run(self): force_init_app() if hasattr(ctx, "queue"): del ctx.queue ctx.queue = DummyQueue({}) if self.args.drop: self.drop() else: self.create()
def run(self): force_init_app() bot_type = self.args.bot_type[0] if bot_type == "telegram": bot = TelegramBot() bot.start() elif bot_type == "icq": bot = ICQBot() bot.start()
def setUpClass(cls) -> None: force_init_app() super().setUpClass() User.ensure_indexes() cls.app = app
import os from cachelib import SimpleCache from glasskit import ctx from ask import app, force_init_app force_init_app() if isinstance(ctx.cache, SimpleCache): if not os.getenv("GLASSKIT_USE_SIMPLE_CACHE"): raise RuntimeError( """Running your application under uwsgi control without centralized cache is dangerous. If you rely on cache invalidation your app instances will be able to invalidate their own in-memory cache while others will consider the same cache keys still valid. If you're sure it's OK for your project please set: GLASSKIT_USE_SIMPLE_CACHE=1 """) app_callable = app.flask