# 대시보드 정제 상태 polling — 항상 주기적 체크

## Lv.1 작업

## 문제
정제 프로세스가 실행 중(`running`)인데 대시보드 UI가 "취소됨"으로 멈춰 있음.

### 원인
`InsuWikiView.js` 417-421줄:
```javascript
if (refineStatus?.status === 'running') {
    const timer = setInterval(pollRefineStatus, 2000);
    return () => clearInterval(timer);
}
```
`status === 'running'`일 때만 2초 간격 polling 시작. 하지만 초기 로드 시 status가 `cancelled`이면 polling이 시작되지 않아, 이후 서버에서 `running`으로 바뀌어도 UI가 갱신 안 됨.

## 수정
`/home/jay/workspace/dashboard/components/InsuWikiView.js` 417-426줄:

현재:
```javascript
useEffect(() => {
    if (refineStatus?.status === 'running') {
        const timer = setInterval(pollRefineStatus, 2000);
        return () => clearInterval(timer);
    }
    if (refineStatus?.status === 'completed') {
        showToast(`정제 완료! ${refineStatus.insightsFound || 0}건 추출`);
        loadStats();
    }
}, [refineStatus?.status, pollRefineStatus]);
```

변경:
```javascript
useEffect(() => {
    // running일 때는 2초, 그 외 상태에서도 5초 간격으로 체크
    const interval = refineStatus?.status === 'running' ? 2000 : 5000;
    const timer = setInterval(pollRefineStatus, interval);

    if (refineStatus?.status === 'completed') {
        showToast(`정제 완료! ${refineStatus.insightsFound || 0}건 추출`);
        loadStats();
    }

    return () => clearInterval(timer);
}, [refineStatus?.status, pollRefineStatus]);
```

변경점:
- `running`일 때: 2초 간격 (기존 유지)
- 그 외 상태(`cancelled`, `idle`, `failed` 등): 5초 간격으로 체크 → 새 정제 시작 시 자동 감지
- `completed` 처리는 기존 그대로 유지

## 수정 후
- 대시보드 재시작: `systemctl --user restart dashboard`

## 보고서
`/home/jay/workspace/memory/reports/task-{TASK_ID}.md`