mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
fix resource_add
This commit is contained in:
@@ -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:
|
||||
"""
|
||||
添加资源
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user