2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

FEATURE: adjust autobump system

- We spread out bumping through the day, if you are bumping
 4 topics then a topic will be bumped every 6 hours

- We add a small, bumping action at the bottom of the post to
 denote a topic got bumped
This commit is contained in:
Sam 2018-07-18 10:17:33 +10:00
parent f146f94ef6
commit 02628883d2
4 changed files with 31 additions and 12 deletions

View file

@ -695,8 +695,11 @@ describe Category do
category = Fabricate(:category)
category.clear_auto_bump_cache!
_post1 = create_post(category: category)
freeze_time 1.second.from_now
post1 = create_post(category: category)
freeze_time 1.second.from_now
_post2 = create_post(category: category)
freeze_time 1.second.from_now
_post3 = create_post(category: category)
# no limits on post creation or category creation please
@ -713,12 +716,17 @@ describe Category do
expect(category.auto_bump_topic!).to eq(true)
expect(Topic.where(bumped_at: time).count).to eq(1)
# our extra bump message
expect(post1.topic.reload.posts_count).to eq(2)
time = time + 13.hours
freeze_time time
expect(category.auto_bump_topic!).to eq(true)
expect(Topic.where(bumped_at: time).count).to eq(2)
expect(Topic.where(bumped_at: time).count).to eq(1)
expect(category.auto_bump_topic!).to eq(false)
expect(Topic.where(bumped_at: time).count).to eq(2)
expect(Topic.where(bumped_at: time).count).to eq(1)
time = 1.month.from_now
freeze_time time