Skip to content

fix: Legacy worker L1/L2 batch loops don't check _worker_running #221

Description

@deucebucket

Bug

In worker.py, the legacy pipeline batch loops for Layer 1 (~line 277) and Layer 2 (~line 312) use while True: loops that only break when processed == 0. They do NOT check _worker_running, so clicking "Stop Worker" has no effect until the current batch naturally completes.

The modular orchestrator path checks _worker_running correctly, but use_modular_pipeline defaults to False so most users hit the legacy path.

Fix

Add if not _worker_running: break at the top of each while True: batch loop in the legacy pipeline path.

Severity

High — worker is unstoppable during L1/L2 processing. Not a data safety risk but a poor UX issue and could waste API quota.

Found via code audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions