mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 10:05:24 +08:00
15 lines
350 B
Ruby
15 lines
350 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class SendPushNotification < ::Jobs::Base
|
|
def execute(args)
|
|
user = User.find_by(id: args[:user_id])
|
|
if !user || user.seen_since?(SiteSetting.push_notification_time_window_mins.minutes.ago)
|
|
return
|
|
end
|
|
|
|
PushNotificationPusher.push(user, args[:payload])
|
|
end
|
|
end
|
|
end
|