예제 #1
0
    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')
예제 #2
0
    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')
예제 #3
0
    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
예제 #4
0
파일: __init__.py 프로젝트: wqlxx/flamenco
    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)