Skip to content

Commit

Permalink
Make sure to update the server id and hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Youch committed Jul 30, 2010
1 parent 9322350 commit e1b2ae1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/tasks/restore.rake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ namespace "cms" do

FileUtils.mkdir_p(storage_dir)
`tar -xzf #{directory + "/storage.tar.gz"} -C #{storage_dir}`
DomainFile.update_all("server_id = #{Server.server_id}", 'file_type != "fld" and private = 0') unless Server.server_id.blank?
end

if(File.exists?(directory + "/private.tar.gz"))
Expand All @@ -118,7 +117,12 @@ namespace "cms" do
FileUtils.rm_rf(private_dir) if(File.directory?(private_dir))
FileUtils.mkdir_p(private_dir)
`tar -xzf #{directory + "/private.tar.gz"} -C #{private_dir}`
DomainFile.update_all("server_id = #{Server.server_id}", 'file_type != "fld" and private = 1') unless Server.server_id.blank?
end

unless Server.server_id.blank?
DomainFile.update_all("server_id = #{Server.server_id}", 'file_type != "fld"')
server_hash = DomainModel.generate_hash
DomainFile.update_all "server_hash = '#{server_hash}'", 'file_type != "fld" and server_hash IS NULL'
end

# Clear out the cache for the domain
Expand Down

0 comments on commit e1b2ae1

Please sign in to comment.