lepus 0.1.1 → 0.1.2

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: dd76ca8d60a80fef01e13aacd4ce59688778fcd00b0d98d448eb252d8ba018f0
4
- data.tar.gz: b934187a671875e0ed1d818b230109f1a3a485fae298125e543a9e5e80936b56
3
+ metadata.gz: 116d40b6e5b9fe75a3d1a97d6a99f73ea17f708d78c3302b2c8d6ea7f1d46b4f
4
+ data.tar.gz: '084d2c433cb8357573484b9750dfb2fad6c2c2e9b3f1ba34304a18a3a7858b17'
5
5
  SHA512:
6
- metadata.gz: 3e6704aa3daea26015095548a93608a3596adaba8b479493bfb43e945a3281171f5164524664768d2e784eb5fe585d1b3c4ea86b57b859f1b7943cc32239342c
7
- data.tar.gz: babc99c5a9de11c5148c64d26599b4a3ce6b6a64296e34b51a31883e9f24622acc02327ea7a0e7cd461336e524f110d8bfb454300e386c0dd054bafabbaec56a
6
+ metadata.gz: fde0c60704a31a5f6686b2344f5489d41111dcb4d1a142e1771941abe9d6ecba60e88cfa5b408697d12ef629289bed5f1e4ebfa9b099c49c41d7d1695aad89b8
7
+ data.tar.gz: 42b3caac7804bfcb060606e4fc2c3f9acd732e2a94e28f6104f9ee6ba29f15d453a9e57530d1076add756e875ba9c57e44b85f9cc836c4db5eb2bf07146474ad
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lepus (0.1.1)
4
+ lepus (0.1.2)
5
5
  base64
6
6
  bunny
7
7
  concurrent-ruby
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- lepus (0.1.1)
4
+ lepus (0.1.2)
5
5
  base64
6
6
  bunny
7
7
  concurrent-ruby
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- lepus (0.1.1)
4
+ lepus (0.1.2)
5
5
  base64
6
6
  bunny
7
7
  concurrent-ruby
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- lepus (0.1.1)
4
+ lepus (0.1.2)
5
5
  base64
6
6
  bunny
7
7
  concurrent-ruby
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- lepus (0.1.1)
4
+ lepus (0.1.2)
5
5
  base64
6
6
  bunny
7
7
  concurrent-ruby
data/lib/lepus/cli.rb CHANGED
@@ -31,6 +31,30 @@ module Lepus
31
31
  Lepus::Supervisor.start(**opts)
32
32
  end
33
33
 
34
+ desc "health_check", "Exit 0 if Lepus workers are alive, 1 if unhealthy (for ECS/K8s probes)"
35
+ method_option :threshold, type: :numeric, default: nil,
36
+ desc: "Max seconds since last heartbeat (default: process_alive_threshold)"
37
+ def health_check
38
+ require "lepus"
39
+
40
+ threshold = options[:threshold] || Lepus.config.process_alive_threshold
41
+ cutoff = Time.now - threshold
42
+
43
+ Lepus::ProcessRegistry.start
44
+ alive = Lepus::ProcessRegistry.all.any? { |p| p.last_heartbeat_at.to_i >= cutoff.to_i }
45
+
46
+ if alive
47
+ puts "ok"
48
+ exit 0
49
+ else
50
+ warn "unhealthy: no workers with heartbeat since #{cutoff}"
51
+ exit 1
52
+ end
53
+ rescue => e
54
+ warn "health_check error: #{e.message}"
55
+ exit 1
56
+ end
57
+
34
58
  desc "web", "Run Lepus Web dashboard"
35
59
  method_option :port, type: :numeric, aliases: "-p", default: 9292, desc: "Port to listen on"
36
60
  method_option :host, type: :string, aliases: "-o", default: "0.0.0.0", desc: "Host to bind"
data/lib/lepus/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lepus
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lepus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos G. Zimmermann
8
8
  autorequire:
9
9
  bindir: exec
10
10
  cert_chain: []
11
- date: 2026-04-27 00:00:00.000000000 Z
11
+ date: 2026-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64