Skip to content

Commit b3407e4

Browse files
committed
Tweaking the local importer
1 parent 0e258da commit b3407e4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bin/import_mails

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ Message.transaction do
2525
begin
2626
if params[:local]
2727
filepath = BASE_DIR.join(list.name, seq.to_s)
28-
raise "No #{seq.to_s}" unless filepath.exist?
29-
next
30-
next unless filepath.exist?
28+
unless filepath.exist?
29+
p "#{list.name}:#{seq} doesn't exist"
30+
next
31+
end
3132

3233
str = File.binread filepath
33-
next if str.blank?
34+
if str.blank?
35+
p "#{list.name}:#{list_seq} is empty"
36+
next
37+
end
3438

3539
mail = Mail.read_from_string str
3640
message = Message.from_mail mail, list, seq

0 commit comments

Comments
 (0)