fix resource_add

This commit is contained in:
Xuwznln
2025-09-19 06:25:28 +08:00
parent 2eaa0ca729
commit a1a55a2c0a
2 changed files with 5 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ class HTTPClient:
info(f"正在使用ak sk作为授权信息[{auth_secret}]")
info(f"HTTPClient 初始化完成: remote_addr={self.remote_addr}")
def resource_edge_add(self, resources: List[Dict[str, Any]], database_process_later: bool) -> requests.Response:
def resource_edge_add(self, resources: List[Dict[str, Any]]) -> requests.Response:
"""
添加资源
@@ -60,7 +60,7 @@ class HTTPClient:
logger.error(f"添加物料关系失败: {response.status_code}, {response.text}")
return response
def resource_add(self, resources: List[Dict[str, Any]], database_process_later: bool) -> requests.Response:
def resource_add(self, resources: List[Dict[str, Any]]) -> requests.Response:
"""
添加资源

View File

@@ -219,7 +219,7 @@ class HostNode(BaseROS2DeviceNode):
client: HTTPClient = bridge
resource_start_time = time.time()
resource_add_res = client.resource_add(add_schema(resources_config), False)
resource_add_res = client.resource_add(add_schema(resources_config))
# DEBUG ONLY
# for i in resource_with_dirs_name:
# http_req = self.bridges[-1].resource_get(i["data"]["unilabos_dirs"], True)
@@ -229,7 +229,7 @@ class HostNode(BaseROS2DeviceNode):
self.lab_logger().info(
f"[Host Node-Resource] 物料上传 {round(resource_end_time - resource_start_time, 5) * 1000} ms"
)
resource_add_res = client.resource_edge_add(self.resources_edge_config, False)
resource_add_res = client.resource_edge_add(self.resources_edge_config)
resource_edge_end_time = time.time()
self.lab_logger().info(
f"[Host Node-Resource] 物料关系上传 {round(resource_edge_end_time - resource_end_time, 5) * 1000} ms"
@@ -865,7 +865,7 @@ class HostNode(BaseROS2DeviceNode):
from unilabos.app.web.client import HTTPClient
client: HTTPClient = self.bridges[-1]
r = client.resource_add(add_schema(resources), False)
r = client.resource_add(add_schema(resources))
success = bool(r)
response.success = success