Class: Jobs::SendPushNotification
- Defined in:
- app/jobs/regular/send_push_notification.rb
Instance Method Summary collapse
Methods inherited from Base
acquire_cluster_concurrency_lock!, clear_cluster_concurrency_lock!, cluster_concurrency, cluster_concurrency_redis_key, delayed_perform, #error_context, get_cluster_concurrency, #last_db_duration, #log, #perform, #perform_immediately
Instance Method Details
#execute(args) ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/jobs/regular/send_push_notification.rb', line 5 def execute(args) user = User.find_by(id: args[:user_id]) push_window = SiteSetting.push_notification_time_window_mins return if !user || (push_window > 0 && user.seen_since?(push_window.minutes.ago)) PushNotificationPusher.push(user, args[:payload]) end |