more intelligent queuing of async jobs

This commit is contained in:
albert
2013-03-03 01:12:31 -05:00
parent b55d40e70a
commit f0b29fc3ba
8 changed files with 23 additions and 25 deletions

View File

@@ -12,7 +12,7 @@ class Upload < ActiveRecord::Base
before_create :convert_cgi_file
after_destroy :delete_temp_file
validate :uploader_is_not_limited
validate :file_or_source_is_present
validate :file_or_source_is_present, :on => :create
module ValidationMethods
def uploader_is_not_limited
@@ -65,11 +65,6 @@ class Upload < ActiveRecord::Base
def process! force=false
return if !force && status =~ /processing|completed|error/
if server != Socket.gethostname
delay.process!
return
end
CurrentUser.scoped(uploader, uploader_ip_addr) do
update_attribute(:status, "processing")
if is_downloadable?