Skip to content

Commit

Permalink
Fix rm -r race condition
Browse files Browse the repository at this point in the history
When starting rich_cms removes the target dir before creating it again
and copying over assets. This can lead to race conditions if you have 
multiple processes starting up, with concurrent corncobs for example.
  • Loading branch information
bittersweet committed Oct 22, 2012
1 parent 7646097 commit 7139264
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/rich/cms/engine.rb
Expand Up @@ -58,7 +58,6 @@ def copy_images
source_dir = File.join File.dirname(__FILE__), "..", "..", "..", "assets", "images", "."
target_dir = File.join Rails.root, "public", "images", "rich", "cms"

FileUtils.rm_r target_dir if File.exists? target_dir
FileUtils.mkdir_p target_dir
FileUtils.cp_r source_dir, target_dir
end
Expand Down

0 comments on commit 7139264

Please sign in to comment.