Skip to content

Commit

Permalink
migrate deps list in redis to runtime only
Browse files Browse the repository at this point in the history
  • Loading branch information
hone authored and nickrivadeneira committed Jun 4, 2011
1 parent 529604f commit b5724fc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions db/migrate/20110601153518_regenerate_runtime_dependencies_list.rb
@@ -0,0 +1,17 @@
class RegenerateRuntimeDependenciesList < ActiveRecord::Migration
def self.up
count = 0
batch_size = 10000
Dependency.find_each(:batch_size => batch_size, :include => :version) do |dep|
puts count if count % batch_size == 0
if dep.version
$redis.del(Dependency.runtime_key(dep.version.full_name))
dep.send(:push_on_to_list)
end
count += 1
end
end

def self.down
end
end

0 comments on commit b5724fc

Please sign in to comment.