Skip to content

Commit

Permalink
Merge branch 'development' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Jones committed May 13, 2011
2 parents 367e664 + a41c657 commit 7a6d36a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/concerns/couriers/fusionable.rb
Expand Up @@ -19,6 +19,7 @@ def client
memoize :client

def execute id
notify "Adding to Fusionable Queue", id
Resque.redis.rpush 'fusionable', id
end

Expand Down
11 changes: 11 additions & 0 deletions lib/tasks/photos.rake
Expand Up @@ -35,6 +35,17 @@ namespace :photos do
end

namespace :process do
desc 'Map non-fusioned rows'
task :coordinates => :environment do
Photo.where(:fusion_row_id => nil).count.fdiv(10).ceil.tap do |times|
times.times do |i|
Photo.skip(i * times).limit(1000).fields(:id).where(:fusion_row_id => nil).each do |photo|
Couriers::Fusionable.execute photo.id
end
end
end
end

[:preview, :showcaser].each do |processor|
desc "Re-render all #{processor.to_s.pluralize}"
task processor => :environment do
Expand Down

0 comments on commit 7a6d36a

Please sign in to comment.