diff --git a/goss-cleanup.rb b/goss-cleanup.rb index d0fdea5..b7a0191 100644 --- a/goss-cleanup.rb +++ b/goss-cleanup.rb @@ -1,7 +1,7 @@ # Federated Computer, Inc. # David Sainty 2024 A.D. # Gossamer Threads to Discourse -- CleanUp Script -# v0.16 Add parallel deletion of posts. +# v0.17 Add more cleanup options. require 'concurrent-ruby' require File.expand_path("../../../../config/environment", __FILE__) @@ -79,7 +79,7 @@ class GossamerForumsCleaner puts "Cleaning up topics with invalid posts_count..." # Iterate through all topics - Topic.where("posts_count IS NULL OR posts_count = -1").find_each do |topic| + Topic.where("posts_count IS NULL OR posts_count = -1 OR posts_count = 0").find_each do |topic| puts "Identified topic for deletion: Title: #{topic.title} Topic ID: #{topic.id}" # Destroy all posts in the topic