about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-20 00:58:28 -0500
committerGitHub <noreply@github.com>2023-02-20 06:58:28 +0100
commit717683d1c39d2fe85d1cc3f5223e1f4cf43f1900 (patch)
treeadf7a7e93197707196ff3fdc7ca476deffede365 /app/workers
parentd2dcb6c45a9db5439772f0553046e2c03a739a16 (diff)
Autofix Rubocop remaining Layout rules (#23679)
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb2
-rw-r--r--app/workers/web/push_notification_worker.rb12
2 files changed, 8 insertions, 6 deletions
diff --git a/app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb b/app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb
index cc5b6e137..09e0b37f0 100644
--- a/app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb
+++ b/app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb
@@ -62,6 +62,7 @@ class Scheduler::AccountsStatusesCleanupScheduler
       # The idea here is to loop through all policies at least once until the budget is exhausted
       # and start back after the last processed account otherwise
       break if budget.zero? || (num_processed_accounts.zero? && first_policy_id.nil?)
+
       first_policy_id = nil
     end
   end
@@ -73,6 +74,7 @@ class Scheduler::AccountsStatusesCleanupScheduler
 
   def under_load?
     return true if Sidekiq::Stats.new.retry_size > MAX_RETRY_SIZE
+
     queue_under_load?('default', MAX_DEFAULT_SIZE, MAX_DEFAULT_LATENCY) || queue_under_load?('push', MAX_PUSH_SIZE, MAX_PUSH_LATENCY) || queue_under_load?('pull', MAX_PULL_SIZE, MAX_PULL_LATENCY)
   end
 
diff --git a/app/workers/web/push_notification_worker.rb b/app/workers/web/push_notification_worker.rb
index 1ed5bb9e0..7e9691aab 100644
--- a/app/workers/web/push_notification_worker.rb
+++ b/app/workers/web/push_notification_worker.rb
@@ -22,13 +22,13 @@ class Web::PushNotificationWorker
       request = Request.new(:post, @subscription.endpoint, body: payload.fetch(:ciphertext), http_client: http_client)
 
       request.add_headers(
-        'Content-Type'     => 'application/octet-stream',
-        'Ttl'              => TTL,
-        'Urgency'          => URGENCY,
+        'Content-Type' => 'application/octet-stream',
+        'Ttl' => TTL,
+        'Urgency' => URGENCY,
         'Content-Encoding' => 'aesgcm',
-        'Encryption'       => "salt=#{Webpush.encode64(payload.fetch(:salt)).delete('=')}",
-        'Crypto-Key'       => "dh=#{Webpush.encode64(payload.fetch(:server_public_key)).delete('=')};#{@subscription.crypto_key_header}",
-        'Authorization'    => @subscription.authorization_header
+        'Encryption' => "salt=#{Webpush.encode64(payload.fetch(:salt)).delete('=')}",
+        'Crypto-Key' => "dh=#{Webpush.encode64(payload.fetch(:server_public_key)).delete('=')};#{@subscription.crypto_key_header}",
+        'Authorization' => @subscription.authorization_header
       )
 
       request.perform do |response|