posts: add workaround to avoid falsely delete pending posts.
Add a temporary workaround for the database index corruption bug. Add a check to skip deleting pending posts if they're not really pending.
This commit is contained in:
@@ -10,12 +10,14 @@ module PostPruner
|
||||
|
||||
def prune_pending!
|
||||
Post.pending.expired.each do |post|
|
||||
next unless post.is_pending?
|
||||
post.delete!("Unapproved in three days", user: User.system)
|
||||
end
|
||||
end
|
||||
|
||||
def prune_flagged!
|
||||
PostFlag.expired.each do |flag|
|
||||
next unless flag.post.is_flagged?
|
||||
flag.post.delete!("Unapproved in three days after returning to moderation queue", user: User.system)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user