discourse/app/jobs/scheduled/unsilence_users.rb

14 lines
308 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-02-05 11:45:47 -05:00
module Jobs
class UnsilenceUsers < Jobs::Scheduled
every 15.minutes
def execute(args)
User.where("silenced_till IS NOT NULL AND silenced_till < now()").find_each do |user|
UserSilencer.unsilence(user, Discourse.system_user)
end
end
end
end