ey_snaplock 0.0.12.pre → 0.0.12.pre.1
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.
- data/lib/ey_snaplock.rb +4 -4
- data/lib/ey_snaplock/version.rb +1 -1
- metadata +2 -2
data/lib/ey_snaplock.rb
CHANGED
|
@@ -83,11 +83,11 @@ module EY
|
|
|
83
83
|
log_file = '/var/log/ey-snaplock.' + Time.now.strftime("%Y-%m-%dT%H-%M-%S") + '.log'
|
|
84
84
|
remaining_retries = LONG_RUNNING_QUERY_RETRIES
|
|
85
85
|
|
|
86
|
-
while database.has_long_running_queries? && remaining_retries >= 0
|
|
86
|
+
while database.has_long_running_queries?(PER_DATABASE_TIMEOUT) && remaining_retries >= 0
|
|
87
87
|
if remaining_retries == 0
|
|
88
88
|
database.dump_process_list(log_file)
|
|
89
89
|
clean_up_old_log_files
|
|
90
|
-
$stderr.puts "
|
|
90
|
+
$stderr.puts "Aborting Snaplock due to long running queries. Process list dumped to #{log_file}."
|
|
91
91
|
exit 1
|
|
92
92
|
else
|
|
93
93
|
sleep PER_DATABASE_TIMEOUT
|
|
@@ -116,8 +116,8 @@ module EY
|
|
|
116
116
|
end
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
def clean_up_old_log_files(
|
|
120
|
-
ordinal =
|
|
119
|
+
def clean_up_old_log_files(logs_to_keep = 10)
|
|
120
|
+
ordinal = logs_to_keep.succ.to_s
|
|
121
121
|
"ls -r /var/log/ey-snaplock.*.log | tail -n +#{ordinal} | xargs -I@ rm @"
|
|
122
122
|
end
|
|
123
123
|
|
data/lib/ey_snaplock/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ey_snaplock
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.12.pre
|
|
4
|
+
version: 0.0.12.pre.1
|
|
5
5
|
prerelease: 7
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-11-
|
|
12
|
+
date: 2012-11-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: addressable
|