Skip to content

Instantly share code, notes, and snippets.

@arfon
Created February 12, 2012 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arfon/1810357 to your computer and use it in GitHub Desktop.
Save arfon/1810357 to your computer and use it in GitHub Desktop.
results = ActiveRecord::Base.connection.execute("select light_curve_id from classifications where zooniverse_user_id=#{user.id}")
results.each { |r| ids << r.first }
ids_to_process = ids.flatten.uniq
require 'enumerator'
unless ids.empty?
ids.each_slice(1000) do |a|
RedisConnect.redis.sadd("zooniverse_user_#{user.id}", *a)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment