log2json 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/redis2es +6 -11
- data/log2json.gemspec +1 -1
- metadata +1 -1
data/bin/redis2es
CHANGED
@@ -131,22 +131,17 @@ def handle_redo_log
|
|
131
131
|
# the main one or the temporary one, or both) is good, and produces only the main
|
132
132
|
# redo log file to be retried.
|
133
133
|
end
|
134
|
-
|
135
|
-
record = ''
|
134
|
+
record = []
|
136
135
|
File.open(REDO_LOG, "r:#{LOG_ENCODING}").each_line do |line|
|
137
136
|
next if line == "\n" or line =~ /^#/
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
end
|
137
|
+
record << line
|
138
|
+
if record.size == 2
|
139
|
+
@queue << record.join('')
|
140
|
+
record.clear()
|
143
141
|
if @queue.size == FLUSH_SIZE
|
144
142
|
LOG.info("Flushing #{@queue.size} records from the redo log(#{REDO_LOG})...")
|
145
143
|
flush_queue() rescue @queue.clear()
|
146
144
|
end
|
147
|
-
else
|
148
|
-
record << line
|
149
|
-
i += 1
|
150
145
|
end
|
151
146
|
end
|
152
147
|
if not @queue.empty?
|
@@ -246,7 +241,7 @@ begin
|
|
246
241
|
main()
|
247
242
|
ensure
|
248
243
|
LOG.warn("Terminating! Flusing the queue(size=#{@queue.size})...")
|
249
|
-
flush_queue()
|
244
|
+
flush_queue() rescue :pass
|
250
245
|
if File.exist?(REDO_LOG) and File.exist?(redo_tempfile_path)
|
251
246
|
LOG.warn("Redo log file(#{REDO_LOG}) already exists!? " +
|
252
247
|
"Please remove it so new redo logs can be written!")
|
data/log2json.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'log2json'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.17'
|
4
4
|
s.summary = "Read, filter and ship logs. ie, poor man's roll-your-own, light-weight logstash replacement."
|
5
5
|
s.description = IO.read(File.join(File.dirname(__FILE__), 'README'))
|
6
6
|
s.authors = ['Jack Kuan']
|