diff --git a/test.py b/test.py index cd645b5..7cab03b 100644 --- a/test.py +++ b/test.py @@ -77,25 +77,17 @@ async def startup(username, device): def push_stream(username, device): MQTT = MQTTClient(broker, port, device, username, username) - try: - MQTT.start() - MQTT.push() - except Exception as e: - # print(e) - pass + MQTT.start() + MQTT.push() def close_stream(username, device): - try: - MQTT = MQTTClient(broker, port, device, username, username) - MQTT.start() - MQTT.close() - except Exception as e: - # print(e) - pass + MQTT = MQTTClient(broker, port, device, username, username) + MQTT.start() + MQTT.close() if __name__ == '__main__': broker = 'mqtt.lihaink.cn' port = 1883 - uvicorn.run(app, host="127.0.0.1", port=8001) + uvicorn.run(app, host="127.0.0.1", port=8000)