FIX: Reduce the time_read threshold to one minute. (#12159)

* FIX: Reduce the time_read threshold to one minute.

Five minutes is too much and could fill the queue with false positives.

* Update spec/jobs/enqueue_suspect_users_spec.rb

Co-authored-by: Arpit Jalan <arpit@techapj.com>

Co-authored-by: Arpit Jalan <arpit@techapj.com>
This commit is contained in:
Roman Rizzi
2021-02-20 08:25:32 -03:00
committed by GitHub
parent dbcda617b3
commit 4e716e9ce5
2 changed files with 4 additions and 4 deletions

View File

@@ -90,15 +90,15 @@ describe Jobs::EnqueueSuspectUsers do
end
it 'enqueues a suspect user with not enough time read' do
suspect_user.user_stat.update!(posts_read_count: 2, topics_entered: 2, time_read: 1.minute.to_i)
suspect_user.user_stat.update!(posts_read_count: 2, topics_entered: 2, time_read: 30.seconds.to_i)
subject.execute({})
expect(ReviewableUser.count).to eq(1)
end
it 'ignores users if their time read is higher than five minutes' do
suspect_user.user_stat.update!(posts_read_count: 2, topics_entered: 2, time_read: 10.minutes.to_i)
it 'ignores users if their time read is higher than one minute' do
suspect_user.user_stat.update!(posts_read_count: 2, topics_entered: 2, time_read: 2.minutes.to_i)
subject.execute({})