From 22175ae2c8c88a96121775170bd6c7576e789e5e Mon Sep 17 00:00:00 2001 From: saint Date: Thu, 29 Aug 2024 23:11:29 +1000 Subject: [PATCH] More goss-cleanup improvements --- goss-cleanup.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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