mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 14:05:37 +08:00
e1f293ad66
Removed sidetiq, introduced new scheduler - add basic UI - add schedule discover - add scheduling in initializer
20 lines
469 B
Ruby
20 lines
469 B
Ruby
require_dependency 'admin_user_index_query'
|
|
|
|
module Jobs
|
|
|
|
class PendingUsersReminder < Jobs::Scheduled
|
|
every 9.hours
|
|
|
|
def execute(args)
|
|
if SiteSetting.must_approve_users
|
|
count = AdminUserIndexQuery.new({query: 'pending'}).find_users_query.count
|
|
if count > 0
|
|
GroupMessage.create(Group[:moderators].name, :pending_users_reminder, {limit_once_per: false, message_params: {count: count}})
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
end
|