Skip to content

Commit 031aabd

Browse files
committed
Use yet another S3 bucket that includes raw mail data
1 parent 9801af5 commit 031aabd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/models/message.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BLADE_BUCKET_REGION = 'ap-northeast-1'
2-
BLADE_BUCKET_NAME = 'blade.ruby-lang.org'
2+
BLADE_BUCKET_NAME = 'blade-data-vault'
33

44
require 'kconv'
55

@@ -93,11 +93,8 @@ def from_mail(mail, list, list_seq)
9393
class << self
9494
def from_s3(list, list_seq, s3_client = Aws::S3::Client.new(region: BLADE_BUCKET_REGION))
9595
obj = s3_client.get_object(bucket: BLADE_BUCKET_NAME, key: "#{list.name}/#{list_seq}")
96-
97-
m = self.from_string(obj.body.read)
98-
m.list_id = list.id
99-
m.list_seq = list_seq
100-
m
96+
mail = Mail.read_from_string obj.body.read.force_encoding(Encoding::BINARY)
97+
Message.from_mail mail, list, list_seq
10198
end
10299

103100
def from_string(str)

0 commit comments

Comments
 (0)