legionio 1.7.14 → 1.7.15

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: 86fc5b0df46813866069443960f455bfd54c68eab894e96e23c763ef1c3356e2
4
- data.tar.gz: f3881012c84c5eaf039ae0c46243e9a97d5aa2ef53092a5b733a1cdeeacf9d08
3
+ metadata.gz: de3b6cd94efb3c63cc92dfcd54303a89fa9517b9a525349b2a40750373e6cb2f
4
+ data.tar.gz: 8cbee81b7503b87a10502b47b308d614e1c22a2675f881c110c9cc8b753561c5
5
5
  SHA512:
6
- metadata.gz: f191aabb91a76ac66d6d71890c2fcdc273f4cbd60f77768a024064b8f58386a6e2791073364c6deb93dfd95b5a8fb8485b0b26c7d0dad67eb5c3d40a1c337289
7
- data.tar.gz: bb61732fe43b41f23e8bb96defb087c206d5d397bd165e3c6eef5c16f9b12e542f88de846639fb767300c5050960f0b7298d83be3d720ab80d5d11096a1008ae
6
+ metadata.gz: bbaa15bc0e0c87a1f72bc8efc84f005e6a1f6b02bb56464436e7cc3d80ec67a9f691107561b3a817d2bb63b5be0f3c0c2b081a5595a491daa29db5328bffb2f2
7
+ data.tar.gz: af119a4f87785f6bc2f05b2c01977e7d352882f20fb1407b6aef7e3ed08f1d96ab5c37f8814f6bd7eb403b554cd9cfb7ea0aa71e46509703e3d34dfe6f6ced2a
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.7.15] - 2026-04-03
6
+
7
+ ### Added
8
+ - Every actors now support `delay` method to defer timer start (used by lex-microsoft_teams)
9
+ - Request logger emits `[api][request-start]` on inbound, warns on responses > 5s
10
+
11
+ ### Changed
12
+ - `/api/reload` disabled (returns 418) to prevent accidental full-restart loops
13
+
5
14
  ## [1.7.14] - 2026-04-03
6
15
 
7
16
  ### Fixed
@@ -9,15 +9,18 @@ module Legion
9
9
  end
10
10
 
11
11
  def call(env)
12
+ method_path = "#{env['REQUEST_METHOD']} #{env['PATH_INFO']}"
13
+ Legion::Logging.info "[api][request-start] #{method_path}"
12
14
  start = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
13
15
  status, headers, body = @app.call(env)
14
16
  duration = ((::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - start) * 1000).round(2)
15
17
 
16
- Legion::Logging.info "[api] #{env['REQUEST_METHOD']} #{env['PATH_INFO']} #{status} #{duration}ms"
18
+ level = duration > 5000 ? :warn : :info
19
+ Legion::Logging.send(level, "[api] #{method_path} #{status} #{duration}ms")
17
20
  [status, headers, body]
18
21
  rescue StandardError => e
19
22
  duration = ((::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - start) * 1000).round(2)
20
- Legion::Logging.error "[api] #{env['REQUEST_METHOD']} #{env['PATH_INFO']} 500 #{duration}ms - #{e.message}"
23
+ Legion::Logging.error "[api] #{method_path} 500 #{duration}ms - #{e.message}"
21
24
  raise
22
25
  end
23
26
  end
data/lib/legion/api.rb CHANGED
@@ -111,8 +111,9 @@ module Legion
111
111
  end
112
112
 
113
113
  post '/api/reload' do
114
- Thread.new { Legion.reload }
115
- json_response({ status: 'reloading' })
114
+ log.error "[api] reload attempted by #{request.ip} — blocked"
115
+ halt 418, { 'Content-Type' => 'application/json' },
116
+ Legion::JSON.dump({ error: 'reload is disabled', status: 418 })
116
117
  end
117
118
 
118
119
  # Global error handlers
@@ -34,7 +34,12 @@ module Legion
34
34
  end
35
35
  end
36
36
 
37
- @timer.execute
37
+ initial_delay = respond_to?(:delay) ? delay.to_f : 0
38
+ if initial_delay.positive?
39
+ Concurrent::ScheduledTask.execute(initial_delay) { @timer.execute }
40
+ else
41
+ @timer.execute
42
+ end
38
43
  rescue StandardError => e
39
44
  handle_exception(e)
40
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Legion
4
- VERSION = '1.7.14'
4
+ VERSION = '1.7.15'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.14
4
+ version: 1.7.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity