mirror of
https://ghfast.top/https://github.com/discourse/discourse-akismet.git
synced 2026-07-15 11:36:24 +08:00
18 lines
491 B
Ruby
18 lines
491 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class CheckForSpamUsers < ::Jobs::Scheduled
|
|
every 20.minutes
|
|
|
|
def execute(args)
|
|
return unless SiteSetting.akismet_enabled?
|
|
return if SiteSetting.akismet_api_key.blank?
|
|
bouncer = DiscourseAkismet::UsersBouncer.new
|
|
client = Akismet::Client.build_client
|
|
|
|
DiscourseAkismet::UsersBouncer.to_check.includes(:user_profile).find_each do |user|
|
|
bouncer.perform_check(client, user)
|
|
end
|
|
end
|
|
end
|
|
end
|