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 +4 -4
- data/Gemfile.lock +1 -1
- data/gemfiles/Gemfile.rails-5.2.lock +1 -1
- data/gemfiles/Gemfile.rails-6.1.lock +1 -1
- data/gemfiles/Gemfile.rails-7.2.lock +1 -1
- data/gemfiles/Gemfile.rails-8.0.lock +1 -1
- data/lib/lepus/cli.rb +24 -0
- data/lib/lepus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 116d40b6e5b9fe75a3d1a97d6a99f73ea17f708d78c3302b2c8d6ea7f1d46b4f
|
|
4
|
+
data.tar.gz: '084d2c433cb8357573484b9750dfb2fad6c2c2e9b3f1ba34304a18a3a7858b17'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fde0c60704a31a5f6686b2344f5489d41111dcb4d1a142e1771941abe9d6ecba60e88cfa5b408697d12ef629289bed5f1e4ebfa9b099c49c41d7d1695aad89b8
|
|
7
|
+
data.tar.gz: 42b3caac7804bfcb060606e4fc2c3f9acd732e2a94e28f6104f9ee6ba29f15d453a9e57530d1076add756e875ba9c57e44b85f9cc836c4db5eb2bf07146474ad
|
data/Gemfile.lock
CHANGED
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
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.
|
|
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-
|
|
11
|
+
date: 2026-05-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|