重构了Mqtt后台服务。

This commit is contained in:
2025-07-13 18:05:31 +08:00
parent 6f16a1c4e4
commit bb5e3bda56
6 changed files with 142 additions and 195 deletions

View File

@@ -158,7 +158,11 @@ public class MqttRepository
.ExecuteCommandAsync();
// Delete menu entry
var menu = await _menuRepository.GetMenuByDataId(mqtt.Id, MenuType.MqttMenu);
await _menuRepository.DeleteMenu(menu, db);
if (menu!=null )
{
await _menuRepository.DeleteMenu(menu, db);
}
await db.CommitTranAsync();
stopwatch.Stop();
NlogHelper.Info($"删除Mqtt配置ID '{mqtt.Id}' 耗时:{stopwatch.ElapsedMilliseconds}ms");