public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
add cache clearing rake task

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2277 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Mon Sep 25 20:18:35 -0700 2006
commit  9075c4a961df2bf993fa88aa9d9f64d3a48f4c5c
tree    619f6f85745e4f907b1f21a6c1f012c80f409301
parent  01df48ed59fb40042fd079dae6a8d13a06e9fe0c
...
1
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
...
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
0
@@ -1 +1,16 @@
0
-STATS_DIRECTORIES << %w(Liquid\ Drops app/drops) << %w(Liquid\ Filters app/filters) << %w(Observers/Sweeprs app/cachers)
0
\ No newline at end of file
0
+STATS_DIRECTORIES << %w(Liquid\ Drops app/drops) << %w(Liquid\ Filters app/filters) << %w(Observers/Sweeprs app/cachers)
0
+
0
+namespace :cache do
0
+ desc "Clear page cache for one or more sites. (rake cache:clear ID=1,2 HOST=foo.com)"
0
+ task :clear => :environment do
0
+ require 'application'
0
+ sites = []
0
+ sites += Site.find(ENV['ID'].split(',')) if ENV['ID']
0
+ sites += Site.find(:all, :conditions => ['host IN (?)', ENV['HOST'].split(',')]) if ENV['HOST']
0
+ sites = Site.find(:all) if sites.empty?
0
+ sites.each do |site|
0
+ ApplicationController.page_cache_directory = site.page_cache_directory.to_s
0
+ puts site.expire_cached_pages(ApplicationController, "Clearing page cache for '#{site.title || "site #{site.id}"}'")
0
+ end
0
+ end
0
+end
0
\ No newline at end of file

Comments

    No one has commented yet.