model_train_dm/backend/apps/cloud_terminal/apps.py
2026-07-27 17:51:49 +08:00

20 lines
585 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import logging
from django.apps import AppConfig
logger = logging.getLogger(__name__)
class CloudTerminalConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "apps.cloud_terminal"
verbose_name = "智能终端(云端孪生镜像)"
def ready(self):
"""Django 启动时自动注册离线检测定时任务每30秒执行一次"""
from .scheduler import start_offline_checker
try:
start_offline_checker()
except Exception:
logger.exception("启动离线检测调度器失败")