def ready(self): try: autodiscover_collections('components.collections') autodiscover_collections('components.collections.sites.%s' % settings.RUN_VER) from pipeline.component_framework.models import ComponentModel from pipeline.component_framework.library import ComponentLibrary ComponentModel.objects.exclude( code__in=ComponentLibrary.components.keys()).update( status=False) except: pass
def ready(self): """ @summary: 注册公共部分和当前RUN_VER下的原子到数据库 @return: """ autodiscover_collections('components.collections') autodiscover_collections('components.collections.sites.%s' % settings.RUN_VER) from pipeline.component_framework.models import ComponentModel from pipeline.component_framework.library import ComponentLibrary try: ComponentModel.objects.exclude(code__in=ComponentLibrary.components.keys()).update(status=False) except ProgrammingError: # first migrate pass
def ready(self): """ @summary: 注册公共部分和OPEN_VER下的变量到数据库 @return: """ from pipeline.variables.signals.handlers import * # noqa for path in settings.VARIABLE_AUTO_DISCOVER_PATH: autodiscover_collections(path) from pipeline.models import VariableModel from pipeline.core.data.library import VariableLibrary try: VariableModel.objects.exclude(code__in=VariableLibrary.variables.keys()).update(status=False) except ProgrammingError: # first migrate pass
def ready(self): """ @summary: 注册公共部分和RUN_VER下的变量到数据库 @return: """ autodiscover_collections('variables.collections') autodiscover_collections('variables.collections.sites.%s' % settings.RUN_VER) from pipeline.models import VariableModel from pipeline.core.data.library import VariableLibrary try: VariableModel.objects.exclude( code__in=VariableLibrary.variables.keys()).update(status=False) except ProgrammingError: # first migrate pass
def ready(self): """ @summary: 注册公共部分和当前RUN_VER下的标准插件到数据库 @return: """ for path in settings.COMPONENT_AUTO_DISCOVER_PATH: autodiscover_collections(path) from pipeline.component_framework.models import ComponentModel from pipeline.component_framework.library import ComponentLibrary try: ComponentModel.objects.exclude(code__in=ComponentLibrary.components.keys()).update(status=False) except ProgrammingError: # first migrate pass
def ready(self): # auto discover collections try: autodiscover_collections('variables.collections') autodiscover_collections('variables.collections.sites.%s' % settings.RUN_VER) from pipeline.models import VariableModel VariableModel.objects.exclude( code__in=VariableLibrary.variables.keys()).update(status=False) except: pass # init redis pool if hasattr(settings, 'REDIS'): pool = redis.ConnectionPool(**settings.REDIS) r = redis.Redis(connection_pool=pool) settings.redis_inst = r