def setup_app(self, app): """Connects Blinker signals and sets up other app-dependent stuff in submodules. """ self._setup_orphan_finder() # Create the flamenco_task_logs collection with a compressing storage engine. # If the zlib compression is too CPU-intensive, switch to Snappy instead. with app.app_context(): self._create_collections(app.db()) from . import managers, jobs, tasks, jwt managers.setup_app(app) jobs.setup_app(app) tasks.setup_app(app) jwt.setup_app(app) private_path = app.config.get('FLAMENCO_JWT_PRIVATE_KEY_PATH') public_path = app.config.get('FLAMENCO_JWT_PUBLIC_KEYS_PATH') if private_path and public_path: self.jwt.token_expiry = app.config.get('FLAMENCO_JWT_TOKEN_EXPIRY') self.jwt.load_keys(pathlib.Path(private_path), pathlib.Path(public_path)), else: self._log.warning( 'Unable to load JWT keys, configure FLAMENCO_JWT_PRIVATE_KEY_PATH ' 'and FLAMENCO_JWT_PUBLIC_KEYS_PATH')
def setup_app(self, app): """Connects Blinker signals and sets up other app-dependent stuff in submodules. """ self._setup_orphan_finder() # Create the flamenco_task_logs collection with a compressing storage engine. # If the zlib compression is too CPU-intensive, switch to Snappy instead. with app.app_context(): self._create_collections(app.db()) from . import managers, jobs, tasks, jwt managers.setup_app(app) jobs.setup_app(app) tasks.setup_app(app) jwt.setup_app(app) private_path = app.config.get('FLAMENCO_JWT_PRIVATE_KEY_PATH') public_path = app.config.get('FLAMENCO_JWT_PUBLIC_KEYS_PATH') if private_path and public_path: self.jwt.token_expiry = app.config.get('FLAMENCO_JWT_TOKEN_EXPIRY') self.jwt.load_keys(pathlib.Path(private_path), pathlib.Path(public_path)), else: self._log.warning('Unable to load JWT keys, configure FLAMENCO_JWT_PRIVATE_KEY_PATH ' 'and FLAMENCO_JWT_PUBLIC_KEYS_PATH')
def setup_app(self, app): """Connects Blinker signals and sets up other app-dependent stuff in submodules.""" from . import comments, jobs, managers, tasks, eve_hooks comments.setup_app(app) jobs.setup_app(app) managers.setup_app(app) tasks.setup_app(app) eve_hooks.setup_app(app) # Imports for side-effects from . import node_url_finders
def setup_app(self, app): """Connects Blinker signals and sets up other app-dependent stuff in submodules. """ self._setup_orphan_finder() # Create the flamenco_task_logs collection with a compressing storage engine. # If the zlib compression is too CPU-intensive, switch to Snappy instead. with app.app_context(): self._create_collections(app.db()) from . import managers, jobs, tasks managers.setup_app(app) jobs.setup_app(app) tasks.setup_app(app)