Refactor busy flags and worker guards
The `WorkerBusy` type was previously a single `Arc<AtomicBool>` shared between the analyze and transcribe workers. This commit refactors this to: - Introduce `AnalyzeBusy` and `TranscribeBusy` newtype wrappers around `WorkerBusy` to distinguish between the two flags. This allows `axum::extract::State` to target them individually. - Move the `BusyGuard` RAII guard into `src/lib.rs` and make it generic to work with any `WorkerBusy` instance. - Update the `main.rs`, `worker.rs`, and `routes/user_web.rs` files to use the new types and guards, ensuring correct state management for both pipelines. - Enhance the transcription recovery scan (`transcribe::recovery::scan_and_enqueue`) to iterate over user directories and call `enqueue_pending_for_user` for each, making it more robust and aligned with the per-user self-healing mechanism. - Add a check for `transcribe_busy` in the `case_detail.html` template to correctly display "Transkription läuft…" only when the transcribe worker is actually active.
This commit is contained in:
@@ -69,7 +69,11 @@ header form { margin: 0; }
|
||||
{% when Some with (t) %}
|
||||
<div class="transcript">{{ t }}</div>
|
||||
{% when None %}
|
||||
{% if transcribe_busy %}
|
||||
<div class="pending">Transkription läuft…</div>
|
||||
{% else %}
|
||||
<div class="pending">Transkription ausstehend.</div>
|
||||
{% endif %}
|
||||
{% endmatch %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user