forked from HXSecurity/DongTai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapps.py
24 lines (18 loc) · 956 Bytes
/
apps.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from dongtai_common.common.utils import DongTaiAppConfigPatch
from django.apps import AppConfig
class IastConfig(DongTaiAppConfigPatch, AppConfig):
name = "dongtai_web"
def ready(self):
super().ready()
register_preheat()
from dongtai_conf.celery import app as celery_app
from dongtai_common.utils.validate import validate_hook_strategy_update
from deploy.commands.management.commands.load_hook_strategy import Command
from dongtai_conf.settings import AUTO_UPDATE_HOOK_STRATEGY
if AUTO_UPDATE_HOOK_STRATEGY and not validate_hook_strategy_update():
print("enable auto_update_hook_strategy updating hook strategy from file")
Command().handle()
def register_preheat():
from dongtai_engine.preheat import PreHeatRegister
from dongtai_web.aggr_vul.aggr_vul_summary import get_annotate_sca_cache_data
PreHeatRegister.register(get_annotate_sca_cache_data)