Comfy-Org / Comfy-Org/ComfyUI_frontend

Redundant jobs query during batch job add

Open
#13,272 3 comments 0 reactions 0 assignees View on GitHub
area:queue perf:speed Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### What problem are you experiencing?

Image

After each `POST /api/prompt` there are 2 `GET /api/jobs`
which may very slow on large queue (like 1000+items) and return data is invalidated immediately after next prompt

### When does this problem occur?

Use `Run` Button with Batch Size > 1

### How often do you encounter this problem?

Daily

### How much does this problem affect your workflow?

Causes moderate inconvenience

### Current workarounds

Use multiple browser tab to process different workflow separately, otherwise if i change workflow tab during active job batch adding, it may just switch to send current workflow, not the workflow i clicked `Run`.

### Ideas for solutions (Optional)

Add throttle to jobs query or disable refetch during batch job queue request

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the Run button and a batch size greater than 1, then trace the batch job request and the resulting GET /api/jobs calls. Confirm how the jobs query is invalidated after each POST /api/prompt; done means redundant queries are avoided without switching away from the workflow being queued.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.