mirror of
https://ghfast.top/https://github.com/discourse/discourse-akismet.git
synced 2026-07-15 11:36:24 +08:00
14 lines
396 B
Ruby
14 lines
396 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class CheckUsersForSpam < ::Jobs::Base
|
|
def execute(args)
|
|
user = User.includes(:user_profile).find_by(id: args[:user_id])
|
|
raise Discourse::InvalidParameters.new(:user_id) unless user.present?
|
|
|
|
DiscourseAkismet.with_client do |client|
|
|
DiscourseAkismet::UsersBouncer.new.check_user(client, user)
|
|
end
|
|
end
|
|
end
|
|
end
|