rubypitaya 1.2.9 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 308569ffd1a21f885317d944646e19c7f95159c4c64b900c3fc89bc5bca2321c
|
4
|
+
data.tar.gz: 4f89dc81fbc999187538019916121cef7d982dafd88edca1fe665518c4c9225b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a6ce18e3c2ff2afb15b1408edd05c2c9ac6920807360d21f1a2e24fc4f68912b5eabf9cf023ec873962150f7547948dab9c039b88febd0493d151fd0a27c04
|
7
|
+
data.tar.gz: 1d0272741a51cea4cd1253185ede2d3c6cbef88a328d4562eacfdc9a9269f96d0af817d51898f9ee154a3428c18aec69768e0fdbb0f27c01ea7372076ebed0a9
|
@@ -62,7 +62,7 @@ GEM
|
|
62
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
63
63
|
rspec-support (~> 3.8.0)
|
64
64
|
rspec-support (3.8.3)
|
65
|
-
rubypitaya (1.
|
65
|
+
rubypitaya (1.3.0)
|
66
66
|
activerecord (= 6.0.2)
|
67
67
|
etcdv3 (= 0.10.2)
|
68
68
|
eventmachine (= 1.2.7)
|
@@ -85,7 +85,7 @@ DEPENDENCIES
|
|
85
85
|
pry (= 0.12.2)
|
86
86
|
rake (= 10.0)
|
87
87
|
rspec (= 3.8.0)
|
88
|
-
rubypitaya (= 1.
|
88
|
+
rubypitaya (= 1.3.0)
|
89
89
|
|
90
90
|
BUNDLED WITH
|
91
91
|
1.17.2
|
data/lib/rubypitaya/core/main.rb
CHANGED
@@ -24,7 +24,6 @@ module RubyPitaya
|
|
24
24
|
|
25
25
|
attr_reader :redis_connector, :config, :bll
|
26
26
|
|
27
|
-
private
|
28
27
|
def initialize
|
29
28
|
@environment_name = ENV.fetch("RUBYPITAYA_ENV") { 'development' }
|
30
29
|
@is_development_environment = @environment_name == 'development'
|
@@ -70,11 +69,40 @@ module RubyPitaya
|
|
70
69
|
|
71
70
|
@handler_router = HandlerRouter.new(Path::HANDLERS_FOLDER_PATH)
|
72
71
|
|
73
|
-
|
74
|
-
|
72
|
+
run_server
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
def run_server
|
78
|
+
@is_shutting_down = false
|
79
|
+
|
80
|
+
catch :sig_shutdown do
|
81
|
+
Signal.trap("SIGINT") { throw :sig_shutdown }
|
82
|
+
Signal.trap("SIGQUIT") { throw :sig_shutdown }
|
83
|
+
Signal.trap("SIGTERM") { throw :sig_shutdown }
|
84
|
+
|
85
|
+
puts "Server started!"
|
86
|
+
run_nats_connection
|
87
|
+
end
|
88
|
+
|
89
|
+
Signal.trap("SIGINT", nil)
|
90
|
+
Signal.trap("SIGQUIT", nil)
|
91
|
+
Signal.trap("SIGTERM", nil)
|
92
|
+
|
93
|
+
shutdown_server
|
94
|
+
end
|
95
|
+
|
96
|
+
def shutdown_server
|
97
|
+
return if @is_shutting_down
|
98
|
+
@is_shutting_down = true
|
99
|
+
|
100
|
+
puts "Server shutting down..."
|
75
101
|
|
76
102
|
@etcd_connector.disconnect
|
77
103
|
@database_connector.disconnect
|
104
|
+
|
105
|
+
exit(0)
|
78
106
|
end
|
79
107
|
|
80
108
|
def run_nats_connection
|
@@ -113,9 +141,6 @@ module RubyPitaya
|
|
113
141
|
|
114
142
|
response
|
115
143
|
end
|
116
|
-
rescue SystemExit, Interrupt
|
117
|
-
puts "Quit!"
|
118
|
-
return 0
|
119
144
|
rescue Exception => error
|
120
145
|
puts "ERROR: #{error}"
|
121
146
|
puts error.backtrace
|
data/lib/rubypitaya/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypitaya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Prestes Cavalcanti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|