diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-19 13:02:25 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-19 13:02:25 +0000 |
commit | bd565325187947ab3bba33f4ce7219d0933b3c0d (patch) | |
tree | c9998593a4e5a849974fb2b1069db4196d85ee13 | |
parent | e06ab9fcc47addc2f397070414a60172080bdd84 (diff) |
Use an atomic write when storing email data.
-rw-r--r-- | app/models/raw_email.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/raw_email.rb b/app/models/raw_email.rb index c6f84318b..6e073aa27 100644 --- a/app/models/raw_email.rb +++ b/app/models/raw_email.rb @@ -43,7 +43,7 @@ class RawEmail < ActiveRecord::Base if !File.exists?(self.directory) FileUtils.mkdir_p self.directory end - File.open(self.filepath, "wb") { |file| + File.atomic_write(self.filepath) { |file| file.write d } end |