Early return from log_queue_enqueue when not active

This commit is contained in:
Kitaiti Makoto 2026-05-23 01:07:28 +09:00
parent d5e20de1a4
commit 620a78aaa0
1 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,11 @@ ruby_whisper_log_queue_enqueue(ruby_whisper_log_queue *log_queue, enum ggml_log_
{
rb_nativethread_lock_lock(&log_queue->lock);
if (!log_queue->is_active) {
rb_nativethread_lock_unlock(&log_queue->lock);
return;
}
size_t len = strlen(text);
ruby_whisper_log *log = &log_queue->logs[log_queue->head];
if (len > log->capacity) {