Skip to content

Commit

Permalink
working on rake task to reprocess images in production
Browse files Browse the repository at this point in the history
  • Loading branch information
Tritico committed Jul 27, 2011
1 parent 1bc376d commit 7893b66
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
23 changes: 21 additions & 2 deletions doc/deploy_instructions
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
For the next deployment:
====================
?
====================


Joe Ellis - 7-24-2011
====================
Joe Ellis - 7-24-2011
====================
run "heroku rake db:migrate" to update to the latest db schema

Expand All @@ -9,4 +14,18 @@ run "heroku console" and inside run the following code:

This code is to add width and height meta data to the images already uploaded

run "heroku restart"
run "heroku restart"

...................................................
(completed 7-27-2011 by tritico)
...................................................
Unfortunatly, this did not work due to a time out.
$ heroku console
Ruby console for noladex.heroku.com
>> User.all.each{|u| u.avatar.reprocess!; u.save!}
Timed out. Long running requests are not supported on the console.
Please consider creating a rake task instead.

So, I added a rake task to noladex.rake and ran "run "heroku rake noladex:reprocess_images" to reprocess images.
Then ran"heroku restart"
...................................................
23 changes: 15 additions & 8 deletions lib/tasks/noladex.rake
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
namespace :noladex do

desc "Ensure all users have perisbale token ..."
task :assign_random_password => :environment do
User.all.each do |u|
p "sending reset mail to #{u.email}"
u.password = rand(0xffffff).to_s(16)
u.save!
PasswordMailer.password_reset(u.email, u.perishable_token).deliver
end
#desc "Ensure all users have perisbale token ..."
#task :assign_random_password => :environment do
# User.all.each do |u|
# p "sending reset mail to #{u.email}"
# u.password = rand(0xffffff).to_s(16)
# u.save!
# PasswordMailer.password_reset(u.email, u.perishable_token).deliver
# end
#end


desc "Add width and height meta data to the images already uploaded ..."
task :reprocess_images => :environment do
User.all.each{|u| u.avatar.reprocess!; u.save!}
end

end

0 comments on commit 7893b66

Please sign in to comment.