Skip to content

Commit f338340

Browse files
chrisryugjclaude
andcommitted
fix: 레이아웃 분석 모델 실패를 선택 기능답게 처리 — 폐쇄망 오해 제거 (이슈 #35 후속)
v3.4.7 사용자 로그로 OCR 본체는 정상 동작 확인(워밍업 185ms, engine initialized dict=11945). MVC 재배포 재설치로 이전 panic(Win32 1114)이 해소됐다. 남은 잡음은 레이아웃 분석 모델 다운로드 실패(os error 11002=DNS, 폐쇄망)가 여전히 눈에 띄던 것. - ensure_layout_model: DOCUFINDER_OFFLINE 이면 다운로드 시도조차 안 함(온라인 전용 선택 기능, 번들 미포함 — OCR 본체와 무관) - 실패 로그를 warn→info 로 낮추고 "OCR 본체는 정상" 을 문구에 명시 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8c11d91 commit f338340

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/src/commands/settings.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,12 +892,17 @@ pub async fn update_settings(
892892
Ok(Ok(_)) => {
893893
let _ = layout_app.emit("model-download-status", "completed-layout");
894894
}
895+
// 레이아웃 분석은 온라인 전용 선택 기능 — 실패해도 OCR 본체는 정상.
896+
// 폐쇄망에서 흔한 실패라 warn 이 아니라 info 로 남긴다(이슈 #35).
895897
Ok(Err(e)) => {
896-
tracing::warn!("레이아웃 모델 다운로드 실패: {}", e);
898+
tracing::info!(
899+
"레이아웃 분석 모델(선택 기능) 미적용 — OCR 본체는 정상 동작합니다: {}",
900+
e
901+
);
897902
let _ = layout_app.emit("model-download-status", "failed-layout");
898903
}
899904
Err(e) => {
900-
tracing::warn!("레이아웃 모델 다운로드 태스크 오류: {}", e);
905+
tracing::info!("레이아웃 분석 모델 태스크 종료(선택 기능): {}", e);
901906
let _ = layout_app.emit("model-download-status", "failed-layout");
902907
}
903908
}

src-tauri/src/model_downloader.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,13 @@ pub fn ensure_layout_model(models_dir: &Path) -> Result<bool, String> {
335335
return Ok(false);
336336
}
337337

338+
// 레이아웃 분석은 온라인 전용 선택 기능(번들 미포함). 폐쇄망 스위치가 켜져 있으면
339+
// 시도조차 하지 않는다 — OCR 본체는 이미 번들로 동작하므로 영향이 없다(이슈 #35).
340+
if offline_mode() {
341+
tracing::info!("오프라인 모드 — 레이아웃 분석 모델(선택 기능) 다운로드를 건너뜁니다");
342+
return Ok(false);
343+
}
344+
338345
tracing::info!("PP-DocLayout 레이아웃 모델 다운로드 중...");
339346
download_file_optional_hash(OCR_LAYOUT_URL, &layout_path, OCR_LAYOUT_SHA256)?;
340347
tracing::info!("PP-DocLayout 레이아웃 모델 다운로드 완료");

0 commit comments

Comments
 (0)