lex-tasker 0.3.7 → 0.3.9

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: 655758b4611fd1b18f693e733f31395f5fbe7e936cc38476222f5a7797d43b9b
4
- data.tar.gz: e6040d7568eebac7c3464c88e496ae16dffcd8ed9a39660ec62c4e436d6510be
3
+ metadata.gz: 18c35b8859f19c3fcde85135428682b14d33b7a8ee14f75500ba49a52934f593
4
+ data.tar.gz: 2f0ab7cd5f1348f71ea9148f8eec7aa21d95253f6ffa92ecf84cf6c9ee1e3614
5
5
  SHA512:
6
- metadata.gz: ca29e06d642a053a81b8ff60ce3c95e09f588a4eb238f5083c71525f951084e1440d1f368fb375f0c3240e4cb091ebfedeb1fedaa3de6e166eb3e246d5666948
7
- data.tar.gz: ab53a69217e469a6c92803dd58e76a9d31ce69d79020085ad5d2b8e5b620e11aa12a73b8b6ff7b5cbf720c5edbe51881512e217a9c8dd3f3726500c3c0cef3a8
6
+ metadata.gz: 0e0c883322095656e755d2d2b2a33531e5aeb37a39dc4e5bf46056d78d635d742cb3c7e77feb5b13059ddde5a941c4809eefcdea1203aa3df21fef332ef83789
7
+ data.tar.gz: 5b31a940e4abd093a0c9f351294b693320daf4f5514a8b556d68e0dbc0ceea988c8886fb4d48431dbe51639dfbb22c0bcc34d46f8ec708f4fb96fdafddf882d6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.8] - 2026-03-31
4
+
5
+ ### Fixed
6
+ - type guard cache returns in `find_trigger` (must be Hash) and `find_subtasks` (must be Array) — cache deserialization can return String instead of Hash, causing `TypeError: no implicit conversion of Symbol into Integer`
7
+ - `check_subtasks` guard changed from `unless trigger` to `unless trigger.is_a?(Hash)` for same reason
8
+
3
9
  ## [0.3.7] - 2026-03-30
4
10
 
5
11
  ### Fixed
@@ -26,7 +26,7 @@ module Legion
26
26
 
27
27
  cache_key = "find_trigger:#{runner_class}:#{function}"
28
28
  cached = cache_get(cache_key)
29
- return cached unless cached.nil?
29
+ return cached if cached.is_a?(Hash)
30
30
 
31
31
  result = Legion::Data::Model::Function
32
32
  .join(:runners, id: :runner_id)
@@ -46,7 +46,7 @@ module Legion
46
46
 
47
47
  cache_key = "find_subtasks:#{trigger_id}"
48
48
  cached = cache_get(cache_key)
49
- return cached unless cached.nil?
49
+ return cached if cached.is_a?(Array)
50
50
 
51
51
  results = subtask_query(trigger_id).all.map do |row|
52
52
  row[:runner_routing_key] = "#{row[:exchange]}.#{row[:queue]}.#{row[:function]}"
@@ -12,7 +12,7 @@ module Legion
12
12
 
13
13
  def check_subtasks(runner_class:, function:, **opts)
14
14
  trigger = find_trigger(runner_class: runner_class, function: function)
15
- return { success: true, subtasks: 0 } unless trigger
15
+ return { success: true, subtasks: 0 } unless trigger.is_a?(Hash)
16
16
 
17
17
  find_subtasks(trigger_id: trigger[:function_id]).each do |relationship|
18
18
  next unless chain_matches?(relationship, opts)
@@ -49,7 +49,7 @@ module Legion
49
49
  if relationship[:conditions].is_a?(String) && relationship[:conditions].length > 4
50
50
  'task.subtask.conditioner'
51
51
  elsif relationship[:transformation].is_a?(String) && relationship[:transformation].length > 4
52
- 'task.subtask.transformation'
52
+ 'task.subtask.transform'
53
53
  else
54
54
  relationship[:runner_routing_key]
55
55
  end
@@ -46,7 +46,7 @@ module Legion
46
46
  if task[:conditions].is_a?(String) && task[:conditions].length > 4
47
47
  'task.subtask.conditioner'
48
48
  elsif task[:transformation].is_a?(String) && task[:transformation].length > 4
49
- 'task.subtask.transformation'
49
+ 'task.subtask.transform'
50
50
  else
51
51
  task[:runner_routing_key]
52
52
  end
@@ -55,7 +55,7 @@ module Legion
55
55
  def update_delayed_status(task_id, routing_key)
56
56
  status = case routing_key
57
57
  when 'task.subtask.conditioner' then 'conditioner.queued'
58
- when 'task.subtask.transformation' then 'transformer.queued'
58
+ when 'task.subtask.transform' then 'transformer.queued'
59
59
  else 'task.queued'
60
60
  end
61
61
  task_update(task_id, status)
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module Tasker
6
- VERSION = '0.3.7'
6
+ VERSION = '0.3.9'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-tasker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity