fix: Unregister sync mode 清除 per-library output — rust_unregister 只刪全域 OUTPUT_DIR
- UI Unregister 走 sync mode → rust_unregister binary - rust_unregister 只用 config::OUTPUT_DIR(demo),不考慮 library → test output 殘留 - 修復: rust_unregister 成功後補呼叫 delete_output_files (掃描全域+per-lib+所有 upload_paths) - 驗證: test 目錄 8 個 output 檔案全清除
This commit is contained in:
@@ -1463,6 +1463,13 @@ async fn unregister(
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
if output.status.success() {
|
if output.status.success() {
|
||||||
|
// rust_unregister only clears the global OUTPUT_DIR (demo).
|
||||||
|
// Also clear per-library output dirs (test, etc.) which it doesn't know about.
|
||||||
|
let extra_deleted = delete_output_files(&uuid, state.db.pool(), None).await;
|
||||||
|
if extra_deleted > 0 {
|
||||||
|
tracing::info!("[UNREGISTER] Sync mode: additionally deleted {} output files across libraries for {}", extra_deleted, uuid);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(Json(UnregisterResponse {
|
Ok(Json(UnregisterResponse {
|
||||||
success: true,
|
success: true,
|
||||||
message: "Unregister completed (sync mode)".to_string(),
|
message: "Unregister completed (sync mode)".to_string(),
|
||||||
|
|||||||
Reference in New Issue
Block a user