Skip to content

Commit 49510f1

Browse files
committed
feat(node): update pasarguard-node-bridge package
1 parent 5b51779 commit 49510f1

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

app/jobs/node_checker.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def verify_node_backend_health(node: PasarGuardNode, node_name: str) -> He
3131
return current_health
3232

3333
try:
34-
await asyncio.wait_for(node.get_backend_stats(), timeout=10)
34+
await node.get_backend_stats()
3535
if current_health != Health.HEALTHY:
3636
await node.set_health(Health.HEALTHY)
3737
logger.debug(f"[{node_name}] Node health is HEALTHY")
@@ -55,15 +55,14 @@ async def update_node_connection_status(node_id: int, node: PasarGuardNode):
5555
Update node connection status by getting backend stats and version info.
5656
"""
5757
try:
58-
await node.get_backend_stats(timeout=8)
59-
xray_version = await node.core_version()
60-
node_version = await node.node_version()
58+
await node.get_backend_stats()
59+
node_version, core_version = await node.get_versions()
6160
async with GetDB() as db:
6261
await NodeOperation._update_single_node_status(
6362
db,
6463
node_id,
6564
NodeStatus.connected,
66-
xray_version=xray_version,
65+
xray_version=core_version,
6766
node_version=node_version,
6867
)
6968
except NodeAPIError as e:
@@ -98,11 +97,9 @@ async def process_node_health_check(db_node: Node, node: PasarGuardNode):
9897
await NodeOperation._update_single_node_status(
9998
db, db_node.id, NodeStatus.error, message="Health check timeout"
10099
)
101-
return
102100
except NodeAPIError as e:
103101
async with GetDB() as db:
104102
await NodeOperation._update_single_node_status(db, db_node.id, NodeStatus.error, message=e.detail)
105-
return
106103

107104
# Skip nodes that are already healthy and connected
108105
if health == Health.HEALTHY and db_node.status == NodeStatus.connected:
@@ -111,12 +108,13 @@ async def process_node_health_check(db_node: Node, node: PasarGuardNode):
111108
# Update status for recovering nodes
112109
if db_node.status in (NodeStatus.connecting, NodeStatus.error) and health == Health.HEALTHY:
113110
async with GetDB() as db:
111+
node_version, core_version = await node.get_versions()
114112
await NodeOperation._update_single_node_status(
115113
db,
116114
db_node.id,
117115
NodeStatus.connected,
118-
xray_version=await node.core_version(),
119-
node_version=await node.node_version(),
116+
xray_version=await core_version,
117+
node_version=await node_version,
120118
)
121119
return
122120

app/notification/telegram/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .host import create_host, modify_host, remove_host, modify_hosts
22
from .user_template import create_user_template, modify_user_template, remove_user_template
3-
from .node import create_node, modify_node, remove_node, connect_node, error_node, limited_node
3+
from .node import create_node, modify_node, remove_node, connect_node, error_node, limited_node, reset_node_usage
44
from .group import create_group, modify_group, remove_group
55
from .core import create_core, modify_core, remove_core
66
from .admin import create_admin, modify_admin, remove_admin, admin_reset_usage, admin_login
@@ -28,6 +28,7 @@
2828
"connect_node",
2929
"error_node",
3030
"limited_node",
31+
"reset_node_usage",
3132
"create_group",
3233
"modify_group",
3334
"remove_group",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies = [
4444
"uvloop>=0.21.0; sys_platform != 'win32'",
4545
"aiorwlock>=1.5.0",
4646
"typer>=0.17.3",
47-
"pasarguard-node-bridge>=0.1.1",
47+
"pasarguard-node-bridge>=0.2.0",
4848
"pip-system-certs>=5.3",
4949
]
5050

uv.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)