mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-17 19:12:37 -05:00
Import scripts: don't include moderator_action posts when calculating bumped_at
This commit is contained in:
parent
24cde6c604
commit
08346974cf
1 changed files with 4 additions and 4 deletions
|
@ -235,10 +235,6 @@ class ImportScripts::Base
|
||||||
PostCreator.create(user, opts)
|
PostCreator.create(user, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_bumped_at
|
|
||||||
Post.exec_sql("update topics t set bumped_at = (select max(created_at) from posts where topic_id = t.id)")
|
|
||||||
end
|
|
||||||
|
|
||||||
def close_inactive_topics(opts={})
|
def close_inactive_topics(opts={})
|
||||||
num_days = opts[:days] || 30
|
num_days = opts[:days] || 30
|
||||||
puts '', "Closing topics that have been inactive for more than #{num_days} days."
|
puts '', "Closing topics that have been inactive for more than #{num_days} days."
|
||||||
|
@ -254,6 +250,10 @@ class ImportScripts::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update_bumped_at
|
||||||
|
Post.exec_sql("update topics t set bumped_at = (select max(created_at) from posts where topic_id = t.id and post_type != #{Post.types[:moderator_action]})")
|
||||||
|
end
|
||||||
|
|
||||||
def print_status(current, max)
|
def print_status(current, max)
|
||||||
print "\r%9d / %d (%5.1f%%) " % [current, max, ((current.to_f / max.to_f) * 100).round(1)]
|
print "\r%9d / %d (%5.1f%%) " % [current, max, ((current.to_f / max.to_f) * 100).round(1)]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue