Skip to content

Fix last few redis events not consistently publishing#174

Open
saimouu wants to merge 1 commit intomainfrom
fix/progress-bar-stuck
Open

Fix last few redis events not consistently publishing#174
saimouu wants to merge 1 commit intomainfrom
fix/progress-bar-stuck

Conversation

@saimouu
Copy link
Copy Markdown
Collaborator

@saimouu saimouu commented Apr 3, 2026

Fix a bug where the last few Redis job progress events would not consistently publish.

Add a final event publish after tasks have completed.

Add buffering controlled with update_interval parameter which is set to 5 by default. Maybe having a time based event update would be slightly better and would cover both small and larger screening tasks.

Resolves #170

counter: Dict[str, int],
counter_lock: asyncio.Lock,
client: AsyncClient,
update_interval: int = 5,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are less than five tasks, will this fail?

Should the update_interval be min(5, task_count)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a final redis event publish in process_job() after the tasks have completed. So it should just go from 0 to completed in a case where it is less than 5.

I'll test.

Though the celery progress will not be updated in that case... Is the celery state and meta used for anything else than tracking/debugging in flower?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Screening progress bar gets stuck

2 participants