功能变化: 添加signal 信号

pull/102/head
李强 2023-07-08 20:08:34 +08:00
parent a42cedf5e3
commit e520d2d3ba
1 changed files with 3 additions and 3 deletions

View File

@ -30,9 +30,9 @@ class Command(BaseCommand):
reset = True reset = True
if isinstance(options.get("n"), list) or isinstance(options.get("N"), list): if isinstance(options.get("n"), list) or isinstance(options.get("N"), list):
reset = False reset = False
signals.pre_init_complete.send(msg='开始初始化', data={"reset": reset}) signals.pre_init_complete.send(sender=None, msg='开始初始化', data={"reset": reset})
for app in settings.INSTALLED_APPS: for app in settings.INSTALLED_APPS:
signals.detail_init_complete.send(msg='初始化中', data={"app": app, "reset": reset}) signals.detail_init_complete.send(sender=None, msg='初始化中', data={"app": app, "reset": reset})
try: try:
exec( exec(
f""" f"""
@ -51,5 +51,5 @@ main(reset={reset})
) )
except ModuleNotFoundError: except ModuleNotFoundError:
pass pass
signals.post_init_complete.send(msg='初始化完成', data={"reset": reset}) signals.post_init_complete.send(sender=None, msg='初始化完成', data={"reset": reset})
print("初始化数据完成!") print("初始化数据完成!")