dblink 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dblink +29 -9
- data/dblink.gemspec +1 -1
- data/lib/dblink/pg_bouncer_runner.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 456b57a2e4619b08713f7921299b7046a5750649
|
4
|
+
data.tar.gz: c704b0a9743500ac4f421452ea9eae534fdde7b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d3e6b98eaf0977bea19f4c88b131c70a0655459462dc1d9bf8b6e7fc9174f2b32538f778a2088b69bb41a2af40ad0524bb4430e5db2ee119b37a51bb2f81f88
|
7
|
+
data.tar.gz: 3387240003ec5445e121f69ee031d99309038c1c7413e4c8203e412e4b673ec1bb8db77b2ef9495544eeeebaa42050cf98c21a1c11f51bbd2066e46ac7b2062e
|
data/bin/dblink
CHANGED
@@ -110,6 +110,16 @@ if CLI_OPTS[:verbose]
|
|
110
110
|
puts "Config folder: #{pgb_runner.tmp_folder}"
|
111
111
|
end
|
112
112
|
|
113
|
+
pgb_runner_at_exit = Proc.new do
|
114
|
+
print "Stoping pgbouncer ..."
|
115
|
+
pgb_runner.stop_async
|
116
|
+
puts
|
117
|
+
end
|
118
|
+
|
119
|
+
at_exit do
|
120
|
+
pgb_runner_at_exit.call
|
121
|
+
end
|
122
|
+
|
113
123
|
print "Starting pgbouncer "
|
114
124
|
pgb_runner.run_async
|
115
125
|
pgb_pid = pgb_runner.wait_for_pid
|
@@ -117,6 +127,23 @@ puts "- " + "OK".green + " (pid: #{pgb_pid})"
|
|
117
127
|
|
118
128
|
print "Starting SSH tonnel "
|
119
129
|
tonnel = TonnelRunner.new(pgb_runner.pgb_port, tmp_dir: pgb_runner.tmp_folder, verbose: CLI_OPTS[:verbose])
|
130
|
+
|
131
|
+
tonnel_at_exit = Proc.new do
|
132
|
+
print "Stoping ssh ..."
|
133
|
+
tonnel.stop_async
|
134
|
+
puts
|
135
|
+
|
136
|
+
tonnel.runner_thread.kill
|
137
|
+
|
138
|
+
puts "Removing tmp dir ..."
|
139
|
+
FileUtils.rm_rf(pgb_runner.tmp_folder)
|
140
|
+
end
|
141
|
+
|
142
|
+
at_exit do
|
143
|
+
pgb_runner_at_exit.call
|
144
|
+
tonnel_at_exit.call
|
145
|
+
end
|
146
|
+
|
120
147
|
tonnel.run_async
|
121
148
|
tonnel.wait_remote_port_allocated
|
122
149
|
|
@@ -168,18 +195,11 @@ if web_response['status'] == 'success'
|
|
168
195
|
end
|
169
196
|
|
170
197
|
at_exit do
|
171
|
-
|
172
|
-
|
173
|
-
puts
|
174
|
-
print "Stoping ssh ..."
|
175
|
-
tonnel.stop_async
|
176
|
-
puts
|
198
|
+
pgb_runner_at_exit.call
|
199
|
+
tonnel_at_exit.call
|
177
200
|
|
178
201
|
tonnel.runner_thread.kill
|
179
202
|
|
180
|
-
puts "Removing tmp dir ..."
|
181
|
-
FileUtils.rm_rf(pgb_runner.tmp_folder)
|
182
|
-
|
183
203
|
exit!
|
184
204
|
end
|
185
205
|
|
data/dblink.gemspec
CHANGED