fix: ensure page2 is closed even on exception in process_single_order
Wrap the order processing logic in try-finally to guarantee cleanup of the popup page regardless of whether processing succeeds or fails. Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
This commit is contained in:
@@ -220,6 +220,7 @@ class DiscreteMaterialPlanCleaner:
|
|||||||
).group(1)
|
).group(1)
|
||||||
|
|
||||||
# 6. 执行清理逻辑
|
# 6. 执行清理逻辑
|
||||||
|
try:
|
||||||
if detail_status == "审批通过":
|
if detail_status == "审批通过":
|
||||||
if detail_count > 0:
|
if detail_count > 0:
|
||||||
# 更新总物料数统计
|
# 更新总物料数统计
|
||||||
@@ -392,6 +393,7 @@ class DiscreteMaterialPlanCleaner:
|
|||||||
self._log("订单已完成,无需处理")
|
self._log("订单已完成,无需处理")
|
||||||
else:
|
else:
|
||||||
self._log(f"订单状态为 [{detail_status}],不符合处理条件", "warn")
|
self._log(f"订单状态为 [{detail_status}],不符合处理条件", "warn")
|
||||||
|
finally:
|
||||||
page2.close()
|
page2.close()
|
||||||
|
|
||||||
def setup_query_interface(self, inner_frame):
|
def setup_query_interface(self, inner_frame):
|
||||||
|
|||||||
Reference in New Issue
Block a user