from django.apps import AppConfig
# from automated_main.utils.publish_consumer import MQListenerThread

"""
    自定义配置类, 通过重写ready方法, 实现服务启动, 进行mq消息监听
"""


class InterfaceMainConfig(AppConfig):
    name = 'automated_main'

    def ready(self):
        """
        Override this method in subclasses to run code when Django starts.
        避免执行两次,  启动命令使用: python manage.py runserver --noreload
        """
        # rocket_consumer = MQListenerThread(self.models)
        # rocket_consumer.setDaemon(True)
        # rocket_consumer.start()
        pass
