fix(dashboard): pause job polling in a hidden tab
Skip the 2 s /api/status poll while document.hidden, and drop the leftover console.log of every status payload.
This commit is contained in:
parent
92c68f9fcf
commit
3f57f4de51
1 changed files with 3 additions and 1 deletions
|
|
@ -474,9 +474,11 @@ function App() {
|
|||
let interval;
|
||||
if ((status === 'processing' || status === 'completed') && jobId) {
|
||||
interval = setInterval(async () => {
|
||||
// Skip a backgrounded tab: with the dashboard open in several tabs the
|
||||
// hidden ones kept polling /api/status and flooding the access log.
|
||||
if (document.hidden) return;
|
||||
try {
|
||||
const data = await pollJob(jobId);
|
||||
console.log("Job status:", data);
|
||||
|
||||
// Update results if available (real-time)
|
||||
if (data.result) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue