Skip to content
This repository was archived by the owner on Jan 8, 2022. It is now read-only.

Commit 202cdf2

Browse files
committed
Stream output and handle errors
1 parent bace6b1 commit 202cdf2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

bin/export-items

+11-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,14 @@ def serialize(item)
3131
end
3232

3333
warn "Exporting #{list.count} items"
34-
35-
puts list.map { |item| serialize(item).to_json }.compact
34+
count = 0
35+
list.find_each do |item|
36+
count += 1
37+
warn count
38+
begin
39+
attributes = serialize(item)
40+
puts attributes.compact.to_json
41+
rescue => e
42+
warn "Error with #{item.pid}. #{e.message}"
43+
end
44+
end

0 commit comments

Comments
 (0)