From bd77fd6ff3cf17a512d26547f78af1e804bd432d Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 8 Jul 2019 02:24:25 +0200 Subject: Fix BackupService crashing when an attachment is missing (#11241) * Fix BackupService crashing when an attachment is missing For various reasons such as admin error or out-of-sync media and database backups, it might be possible for local attachments to be lost. This commit allows the BackupService to continue its work even if some media file is missing. * Change error message --- app/services/backup_service.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/services/backup_service.rb b/app/services/backup_service.rb index bd9e77223..cc9fb1f4e 100644 --- a/app/services/backup_service.rb +++ b/app/services/backup_service.rb @@ -164,5 +164,7 @@ class BackupService < BaseService io.write(buffer) end end + rescue Errno::ENOENT + Rails.logger.warn "Could not backup file #{filename}: file not found" end end -- cgit From 9f67e3b9cccb49efd3f3728e0d1a5f68378a11c5 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 8 Jul 2019 18:17:22 +0200 Subject: Fix Status.remote scope matching *all* statuses (#11265) --- app/models/status.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/status.rb b/app/models/status.rb index 5ddce72de..5adccb722 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -82,7 +82,7 @@ class Status < ApplicationRecord default_scope { recent } scope :recent, -> { reorder(id: :desc) } - scope :remote, -> { where(local: false).or(where.not(uri: nil)) } + scope :remote, -> { where(local: false).where.not(uri: nil) } scope :local, -> { where(local: true).or(where(uri: nil)) } scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') } -- cgit From 99c1f0811b14474d268bd237c04a0ccedb3d2d5e Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 11 Jul 2019 14:50:27 +0200 Subject: Fix BlockService trying to reject incorrect follow request (#11288) Fixes #11148 --- app/services/block_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/services/block_service.rb b/app/services/block_service.rb index 9050a4858..0d9a6eccd 100644 --- a/app/services/block_service.rb +++ b/app/services/block_service.rb @@ -8,7 +8,7 @@ class BlockService < BaseService UnfollowService.new.call(account, target_account) if account.following?(target_account) UnfollowService.new.call(target_account, account) if target_account.following?(account) - RejectFollowService.new.call(account, target_account) if target_account.requested?(account) + RejectFollowService.new.call(target_account, account) if target_account.requested?(account) block = account.block!(target_account) -- cgit From 0442fcdbc88c2a77b1216c38d2fb5fe11bec334d Mon Sep 17 00:00:00 2001 From: "han@highemelry" Date: Sat, 13 Jul 2019 01:46:21 +0900 Subject: Change the retry limit in error of web push notification (#11292) - Change the maximum count of retry for web push notification (Default -> 5). - In case of high load of subscribe server, the retries will be repeated many times. - Because the retries occupy the default queue, maximum retry count should be reduced. --- app/workers/web/push_notification_worker.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/workers/web/push_notification_worker.rb b/app/workers/web/push_notification_worker.rb index 8e8a35973..901043975 100644 --- a/app/workers/web/push_notification_worker.rb +++ b/app/workers/web/push_notification_worker.rb @@ -3,7 +3,7 @@ class Web::PushNotificationWorker include Sidekiq::Worker - sidekiq_options backtrace: true + sidekiq_options backtrace: true, retry: 5 def perform(subscription_id, notification_id) subscription = ::Web::PushSubscription.find(subscription_id) -- cgit