about summary refs log tree commit diff
path: root/app/workers/push_notification_worker.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-29 01:30:32 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-29 01:30:32 +0100
commit3f075c7794ca7cc6e3c566591e9929859c6c325c (patch)
treefd649accdafbb57cf1ac5d7231dd44bd5dd447c8 /app/workers/push_notification_worker.rb
parent1992575d577bf5b4c408a0104ad310e17846466a (diff)
API for apps to register for push notifications
Diffstat (limited to 'app/workers/push_notification_worker.rb')
-rw-r--r--app/workers/push_notification_worker.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/workers/push_notification_worker.rb b/app/workers/push_notification_worker.rb
new file mode 100644
index 000000000..a61d0e349
--- /dev/null
+++ b/app/workers/push_notification_worker.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class PushNotificationWorker
+  include Sidekiq::Worker
+
+  def perform(notification_id)
+    SendPushNotificationService.new.call(Notification.find(notification_id))
+  rescue ActiveRecord::RecordNotFound
+    true
+  end
+end