Skip to content

Commit c88c43d

Browse files
committed
remove the signal handler as it is not used anywhere and things like puma should really be in charge
1 parent d7b7c74 commit c88c43d

File tree

6 files changed

+2
-228
lines changed

6 files changed

+2
-228
lines changed

docs/design.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ lib/hooks/
140140
│ ├── config_loader.rb # Loads + merges per-endpoint configs
141141
│ ├── config_validator.rb # Dry::Schema-based validation
142142
│ ├── logger_factory.rb # Structured JSON logger + context enrichment
143-
│ └── signal_handler.rb # Trap SIGINT/SIGTERM for graceful shutdown
144143
145144
├── handlers/
146145
│ └── base.rb # `Hooks::Handlers::Base` interface: defines #call

lib/hooks/app/api.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ module App
1313
# Factory for creating configured Grape API classes
1414
class API
1515
# Create a new configured API class
16-
def self.create(config:, endpoints:, log:, signal_handler:)
16+
def self.create(config:, endpoints:, log:)
1717
# Store startup time for uptime calculation
1818
start_time = Time.now
1919

2020
# Capture values in local variables for closure
2121
captured_config = config
2222
captured_endpoints = endpoints
2323
captured_logger = log
24-
_captured_signal_handler = signal_handler
2524
captured_start_time = start_time
2625

2726
# Set global logger instance for plugins/validators

lib/hooks/core/builder.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require_relative "config_loader"
44
require_relative "config_validator"
55
require_relative "logger_factory"
6-
require_relative "signal_handler"
76
require_relative "../app/api"
87

98
module Hooks
@@ -34,9 +33,6 @@ def build
3433
)
3534
end
3635

37-
# Setup signal handler for graceful shutdown
38-
signal_handler = SignalHandler.new(@log)
39-
4036
# Load endpoints
4137
endpoints = load_endpoints(config)
4238

@@ -50,8 +46,7 @@ def build
5046
Hooks::App::API.create(
5147
config: config,
5248
endpoints: endpoints,
53-
log: @log,
54-
signal_handler: signal_handler
49+
log: @log
5550
)
5651
end
5752

lib/hooks/core/signal_handler.rb

Lines changed: 0 additions & 55 deletions
This file was deleted.

spec/unit/lib/hooks/core/builder_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
expect(args[:config]).to be_a(Hash)
9898
expect(args[:endpoints]).to eq([])
9999
expect(args[:log]).to respond_to(:info)
100-
expect(args[:signal_handler]).to be_a(Hooks::Core::SignalHandler)
101100
"mock_api"
102101
end
103102

spec/unit/lib/hooks/core/signal_handler_spec.rb

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)