forked from iti-framework/iTi-Flask
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
519 B
Python
19 lines
519 B
Python
from .influxdb_mgr import iot_influxdb
|
|
from .rocketmq_mgr import iot_rocketmq
|
|
|
|
|
|
def init_iot(app) -> None:
|
|
import logging
|
|
logger = logging.getLogger(__name__)
|
|
|
|
try:
|
|
iot_influxdb.init_app(app)
|
|
except Exception as e:
|
|
logger.error(f"初始化influxdb_mgr失败: {e}", exc_info=True)
|
|
|
|
try:
|
|
iot_rocketmq.init_app(app)
|
|
iot_rocketmq.start_consumer("iot-collect-topic", "*")
|
|
except Exception as e:
|
|
logger.error(f"初始化rocketmq_mgr失败: {e}", exc_info=True)
|