fix: keep prewrite-cancelled CBBs available for fresh admission

This commit is contained in:
阿白叔 committed 2026-11-23 19:34:25 +08:00
1 parent 48f38d1bdd
commit 3b4323405a
3 files changed
+46 -5

No files matched your search

+8 -4
View File
@@ -1951,7 +1951,11 @@ class MainWindow(QWidget):
write_maintenance_report(requests, results, report, ())
except Exception as error:
self._emit_job(job, 'event', {'stage': 'report_failed', 'detail': str(error)})
affected = [req.block_name for req, result in zip(requests, results) if result.status != 'SKIPPED']
# A proven pre-write cancel can be submitted again. The next
# admission still rereads the catalog, status and occupancy.
affected = [req.block_name for req, result in zip(requests, results)
if result.status != 'SKIPPED'
and not (result.status == 'CANCELLED' and result.cancelled_before_write)]
safe = all(result.safe_to_continue for result in results)
self._emit_job(job, 'batch_ready', (results, report))
refresh = None
@@ -2202,12 +2206,12 @@ class MainWindow(QWidget):
if len(outcome) <= 2:
return
results, _, affected, refresh = outcome
if refresh is None:
if refresh is not None:
self._apply_refreshed_records(refresh)
elif affected:
reason = ('状态尚未复核,请重新读取。' if all(r.safe_to_continue for r in results)
else '会话或数据库安全未确认;暂缓原生状态复核,请确认释放后重新读取。')
self._defer_status_refresh(affected, reason)
else:
self._apply_refreshed_records(refresh)
from shiboken6 import isValid
summary = getattr(self, 'summary', None)
self.status_label.setText(summary.text().replace('\n', ' ') if summary is not None and isValid(summary)