ox-ai-workers 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff50d91eb53d6cad821557f5c103128f4881a9281de7518b094b0792b4cbda46
4
- data.tar.gz: 3ef9261b02ecbb2bc7dc90f703174f6c0dfc406856b20061eaee208cdca47778
3
+ metadata.gz: 68d97fd108d7781f5761271c70a32143c491cc95ceaf345b2e9277253e7edf07
4
+ data.tar.gz: db1ad80e6fee22ebffa4ff4273dff3cf7e9cd5d23909058722cd21f6a9ee1481
5
5
  SHA512:
6
- metadata.gz: 4e2ef85d37cfcb2821705df4dc5ed621f2db7dba1543e95ca82111dfcc145f9594094861c50bb68df285f1641073c1931358fff36e09cda34ee1a07ab0b0f4e5
7
- data.tar.gz: 4e463f6ef03c29a001cbe6c783829c39369b2f4d8acc95cad8eeeb2791495b52d8418325cb1d21de434a40ae912324d0f0f1528fdc12b48f9400122ef8eeeff9
6
+ metadata.gz: e87f891e063be2234ebc772f00966139f6fd2bf9efe0d24c19e60491a28cabf8e8881050629f19497b19b8462b41fea275f1442175122582eda3ca5b42fc69e2
7
+ data.tar.gz: 269c70ebe72eef95f6a3d6c7de312f57161b17b4eaa80fcc426bf006655aff44e16fab4c84bdb366d4b8f8f6fdf9af58bee43ef36e97a98ba6d5fce3201a7d86
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.1.4] - 2025-07-11
2
+
3
+ - Fixed `finish_it` for `Iterator`
4
+
1
5
  ## [1.1.2] - 2025-05-26
2
6
 
3
7
  - Removed task appending in `Iterator`
@@ -176,6 +176,13 @@ module OxAiWorkers
176
176
  end
177
177
 
178
178
  def next_iteration
179
+ # Проверяем call_stack перед продолжением итерации
180
+ if should_finish_iteration?
181
+ OxAiWorkers.logger.info "Iterator::Call stack is empty or contains only finish_it. Finishing iteration."
182
+ finish_it
183
+ return
184
+ end
185
+
179
186
  # Сначала добавляем сообщения из очереди к worker
180
187
  @worker.append(messages: @queue)
181
188
  # Затем добавляем их к локальным сообщениям
@@ -186,6 +193,17 @@ module OxAiWorkers
186
193
  request!
187
194
  end
188
195
 
196
+ def should_finish_iteration?
197
+ return false unless @worker.respond_to?(:call_stack) && @worker.call_stack.present?
198
+
199
+ finish_it_function = OxAiWorkers::Iterator.full_function_name(:finish_it)
200
+
201
+ # Проверяем, пуста ли очередь вызовов или содержит только finish_it
202
+ @worker.call_stack.empty? ||
203
+ (@worker.call_stack.size == 1 && @worker.call_stack.first == finish_it_function) ||
204
+ @worker.call_stack.all? { |call| call == finish_it_function }
205
+ end
206
+
189
207
  def external_request
190
208
  @worker.request!
191
209
  tick_or_wait
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OxAiWorkers
4
- VERSION = '1.1.3'
4
+ VERSION = '1.1.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox-ai-workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Smolev