Skip to content

Commit

Permalink
Merge pull request #3025 from alphagov/temp-whitehall-frontend-items
Browse files Browse the repository at this point in the history
Add temporary rake task to remove old whitehall-frontend rendered editions
  • Loading branch information
callumknights authored Dec 5, 2024
2 parents 38cfb45 + ce0df7d commit 9c025e7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/tasks/data_hygiene.rake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ namespace :data_hygiene do
end
end

desc "Unpublish remaining whitehall-frontend rendered editions"
task unpublish_whitehall_frontend: :environent do
whitehall_frontend_documents = Edition
.where(state: "published", rendering_app: "whitehall-frontend")
.map { |edition| edition.document.content_id }

whitehall_frontend_documents.each do |content_id|
Commands::V2::Unpublish.call(
{
content_id: content_id,
type: "gone",
},
)
end
end

desc "Check the status of a document whether it's in Content Store or Router."
task :document_status_check, %i[content_id locale] => :environment do |_, args|
document = Document.find_by!(args.to_hash)
Expand Down

0 comments on commit 9c025e7

Please sign in to comment.