fix: 修复心跳检查中订阅状态判断逻辑,避免启动时误触发重连
This commit is contained in:
parent
5dc1081c90
commit
0893c9783c
|
|
@ -296,7 +296,7 @@ impl ConnectionManager {
|
||||||
Err(_) => false,
|
Err(_) => false,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 检查订阅状态
|
// 检查订阅状态 - 仅当有 subscription_id 时才检查
|
||||||
let subscription_valid = {
|
let subscription_valid = {
|
||||||
let status = manager.status.read().await;
|
let status = manager.status.read().await;
|
||||||
if let Some(conn_status) = status.get(&source_id) {
|
if let Some(conn_status) = status.get(&source_id) {
|
||||||
|
|
@ -315,9 +315,11 @@ impl ConnectionManager {
|
||||||
Err(_) => false,
|
Err(_) => false,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
false
|
// 没有 subscription_id 时,认为订阅状态有效(不需要检查)
|
||||||
|
true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 没有连接状态时,认为订阅状态无效
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue