Permalink
Browse files

Rails doesn't like timestamps in the future

  • Loading branch information...
1 parent 87e9549 commit 145be86e0dbb1a9a2e02db05f536eb80cd15a829 @rubys committed Dec 11, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/gorp/edit.rb
View
@@ -176,7 +176,10 @@ def edit filename, tag=nil, &block
now = Time.now
sleep stale-now+1 if now.to_i <= stale.to_i
open(filename,'w') {|file| file.write data}
- File.utime(stale+2, stale+2, filename) if File.mtime(filename) <= stale
+ while File.mtime(filename) <= stale
+ sleep 1
+ open(filename,'w') {|file| file.write data}
+ end
rescue Exception => e
$x.pre :class => 'traceback' do

0 comments on commit 145be86

Please sign in to comment.