summaryrefslogtreecommitdiff
path: root/lib/tasks/heater.rake
blob: 11862a5b81f85d1c3130e65fa9fe1b67cb8041ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
namespace :heater do
  desc "Warm up the cache."
  task :preheat => :environment do
    if GemeinschaftSetup.any?

    else
      # This is a fresh installation.
      #
      if Rails.env.production?
        require 'open-uri'
        open('/dev/null', 'wb') do |file|
          file << open("http://localhost/gemeinschaft_setups/new").read
        end
      end
    end
  end
end