Skip to content

Commit

Permalink
Fix order of operations and made it easier to restore old sites
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Sep 16, 2010
1 parent 3896977 commit d2d14aa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/tasks/restore.rake
Expand Up @@ -99,8 +99,6 @@ namespace "cms" do
puts("There was a problem rebuilding domain file instances - importing domain anyway")
end

SiteTemplate.find(:all).map(&:save)
SiteFeature.find(:all).map(&:save)

if(File.exists?(directory + "/storage.tar.gz"))

Expand All @@ -125,6 +123,13 @@ namespace "cms" do
DomainFile.update_all "server_hash = '#{server_hash}'", 'file_type != "fld" and server_hash IS NULL'
end

begin
SiteTemplate.find(:all).map(&:save)
SiteFeature.find(:all).map(&:save)
rescue Exception => e
puts("There was a problem resaving site templates and features - continuing import anyway")
end

# Clear out the cache for the domain
DataCache.expire_domain(dmn.database)

Expand Down

0 comments on commit d2d14aa

Please sign in to comment.