mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Compare commits
4 commits
662c885e7d
...
1da00a231e
Author | SHA1 | Date | |
---|---|---|---|
|
1da00a231e | ||
|
a50c8e951f | ||
|
2c1e75727d | ||
|
4f8bf2b0cd |
91 changed files with 104 additions and 256 deletions
|
@ -60,7 +60,7 @@ export interface BaseNotificationGroupJSON {
|
|||
|
||||
interface NotificationGroupWithStatusJSON extends BaseNotificationGroupJSON {
|
||||
type: NotificationWithStatusType;
|
||||
status: ApiStatusJSON;
|
||||
status_id: string;
|
||||
}
|
||||
|
||||
interface NotificationWithStatusJSON extends BaseNotificationJSON {
|
||||
|
|
|
@ -49,21 +49,14 @@ export const FilteredNotificationsBanner: React.FC = () => {
|
|||
<span>
|
||||
<FormattedMessage
|
||||
id='filtered_notifications_banner.pending_requests'
|
||||
defaultMessage='Notifications from {count, plural, =0 {no one} one {one person} other {# people}} you may know'
|
||||
defaultMessage='From {count, plural, =0 {no one} one {one person} other {# people}} you may know'
|
||||
values={{ count: policy.summary.pending_requests_count }}
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className='filtered-notifications-banner__badge'>
|
||||
<div className='filtered-notifications-banner__badge__badge'>
|
||||
{toCappedNumber(policy.summary.pending_notifications_count)}
|
||||
</div>
|
||||
<FormattedMessage
|
||||
id='filtered_notifications_banner.mentions'
|
||||
defaultMessage='{count, plural, one {mention} other {mentions}}'
|
||||
values={{ count: policy.summary.pending_notifications_count }}
|
||||
/>
|
||||
{toCappedNumber(policy.summary.pending_notifications_count)}
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
|
|
|
@ -300,8 +300,7 @@
|
|||
"filter_modal.select_filter.subtitle": "Use an existing category or create a new one",
|
||||
"filter_modal.select_filter.title": "Filter this post",
|
||||
"filter_modal.title.status": "Filter a post",
|
||||
"filtered_notifications_banner.mentions": "{count, plural, one {mention} other {mentions}}",
|
||||
"filtered_notifications_banner.pending_requests": "Notifications from {count, plural, =0 {no one} one {one person} other {# people}} you may know",
|
||||
"filtered_notifications_banner.pending_requests": "From {count, plural, =0 {no one} one {one person} other {# people}} you may know",
|
||||
"filtered_notifications_banner.title": "Filtered notifications",
|
||||
"firehose.all": "All",
|
||||
"firehose.local": "This server",
|
||||
|
|
|
@ -124,9 +124,9 @@ export function createNotificationGroupFromJSON(
|
|||
case 'mention':
|
||||
case 'poll':
|
||||
case 'update': {
|
||||
const { status, ...groupWithoutStatus } = group;
|
||||
const { status_id: statusId, ...groupWithoutStatus } = group;
|
||||
return {
|
||||
statusId: status.id,
|
||||
statusId,
|
||||
sampleAccountIds,
|
||||
...groupWithoutStatus,
|
||||
};
|
||||
|
|
|
@ -10171,25 +10171,10 @@ noscript {
|
|||
}
|
||||
|
||||
&__badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 999px;
|
||||
background: var(--background-border-color);
|
||||
color: $darker-text-color;
|
||||
padding: 4px;
|
||||
padding-inline-end: 8px;
|
||||
gap: 6px;
|
||||
font-weight: 500;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
word-break: keep-all;
|
||||
|
||||
&__badge {
|
||||
background: $ui-button-background-color;
|
||||
color: $white;
|
||||
border-radius: 100px;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
background: $ui-button-background-color;
|
||||
color: $white;
|
||||
border-radius: 100px;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AccountDeletionWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class AccountDeletionWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.week.to_i
|
||||
|
||||
def perform(account_id, options = {})
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AccountMergingWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class AccountMergingWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull'
|
||||
|
||||
def perform(account_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AccountRefreshWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class AccountRefreshWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', retry: 3, dead: false, lock: :until_executed, lock_ttl: 1.day.to_i
|
||||
|
||||
def perform(account_id)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::DeliveryWorker
|
||||
include Sidekiq::Worker
|
||||
class ActivityPub::DeliveryWorker < ApplicationWorker
|
||||
include RoutingHelper
|
||||
include JsonLdHelper
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::DistributePollUpdateWorker
|
||||
include Sidekiq::Worker
|
||||
class ActivityPub::DistributePollUpdateWorker < ApplicationWorker
|
||||
include Payloadable
|
||||
|
||||
sidekiq_options queue: 'push', lock: :until_executed, retry: 0
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::FetchRepliesWorker
|
||||
include Sidekiq::Worker
|
||||
class ActivityPub::FetchRepliesWorker < ApplicationWorker
|
||||
include ExponentialBackoff
|
||||
|
||||
sidekiq_options queue: 'pull', retry: 3
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::FollowersSynchronizationWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class ActivityPub::FollowersSynchronizationWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'push', lock: :until_executed
|
||||
|
||||
def perform(account_id, url)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::MoveDistributionWorker
|
||||
include Sidekiq::Worker
|
||||
class ActivityPub::MoveDistributionWorker < ApplicationWorker
|
||||
include Payloadable
|
||||
|
||||
sidekiq_options queue: 'push'
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::PostUpgradeWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class ActivityPub::PostUpgradeWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull'
|
||||
|
||||
def perform(domain)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::ProcessingWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class ActivityPub::ProcessingWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'ingress', backtrace: true, retry: 8
|
||||
|
||||
def perform(actor_id, body, delivered_to_account_id = nil, actor_type = 'Account')
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::RawDistributionWorker
|
||||
include Sidekiq::Worker
|
||||
class ActivityPub::RawDistributionWorker < ApplicationWorker
|
||||
include Payloadable
|
||||
|
||||
sidekiq_options queue: 'push'
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::SynchronizeFeaturedCollectionWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class ActivityPub::SynchronizeFeaturedCollectionWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.day.to_i
|
||||
|
||||
def perform(account_id, options = {})
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::SynchronizeFeaturedTagsCollectionWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class ActivityPub::SynchronizeFeaturedTagsCollectionWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.day.to_i
|
||||
|
||||
def perform(account_id, url)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddToPublicStatusesIndexWorker
|
||||
include Sidekiq::Worker
|
||||
class AddToPublicStatusesIndexWorker < ApplicationWorker
|
||||
include DatabaseHelper
|
||||
|
||||
sidekiq_options queue: 'pull'
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Admin::AccountDeletionWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Admin::AccountDeletionWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.week.to_i
|
||||
|
||||
def perform(account_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Admin::DomainPurgeWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Admin::DomainPurgeWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.week.to_i
|
||||
|
||||
def perform(domain)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Admin::SuspensionWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Admin::SuspensionWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull'
|
||||
|
||||
def perform(account_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Admin::UnsuspensionWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Admin::UnsuspensionWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull'
|
||||
|
||||
def perform(account_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AfterAccountDomainBlockWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class AfterAccountDomainBlockWorker < ApplicationWorker
|
||||
def perform(account_id, domain)
|
||||
AfterBlockDomainFromAccountService.new.call(Account.find(account_id), domain)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AfterUnallowDomainWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class AfterUnallowDomainWorker < ApplicationWorker
|
||||
def perform(domain)
|
||||
AfterUnallowDomainService.new.call(domain)
|
||||
end
|
||||
|
|
9
app/workers/application_worker.rb
Normal file
9
app/workers/application_worker.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
def perform(*)
|
||||
raise NotImplementedError
|
||||
end
|
||||
end
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AuthorizeFollowWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class AuthorizeFollowWorker < ApplicationWorker
|
||||
def perform(source_account_id, target_account_id)
|
||||
source_account = Account.find(source_account_id)
|
||||
target_account = Account.find(target_account_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BackupWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class BackupWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', backtrace: true, retry: 5, dead: false
|
||||
|
||||
sidekiq_retries_exhausted do |msg|
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BlockWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class BlockWorker < ApplicationWorker
|
||||
def perform(account_id, target_account_id)
|
||||
AfterBlockService.new.call(
|
||||
Account.find(account_id),
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BootstrapTimelineWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class BootstrapTimelineWorker < ApplicationWorker
|
||||
def perform(account_id)
|
||||
BootstrapTimelineService.new.call(Account.find(account_id))
|
||||
end
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BulkImportWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class BulkImportWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', retry: false
|
||||
|
||||
def perform(import_id)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CacheBusterWorker
|
||||
include Sidekiq::Worker
|
||||
class CacheBusterWorker < ApplicationWorker
|
||||
include RoutingHelper
|
||||
|
||||
sidekiq_options queue: 'pull'
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DeleteMuteWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class DeleteMuteWorker < ApplicationWorker
|
||||
def perform(mute_id)
|
||||
mute = Mute.find_by(id: mute_id)
|
||||
UnmuteService.new.call(mute.account, mute.target_account) if mute&.expired?
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DistributionWorker
|
||||
include Sidekiq::Worker
|
||||
class DistributionWorker < ApplicationWorker
|
||||
include Redisable
|
||||
include Lockable
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DomainBlockWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class DomainBlockWorker < ApplicationWorker
|
||||
def perform(domain_block_id, update = false)
|
||||
domain_block = DomainBlock.find_by(id: domain_block_id)
|
||||
return true if domain_block.nil?
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DomainClearMediaWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class DomainClearMediaWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull'
|
||||
|
||||
def perform(domain_block_id)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class FeedInsertWorker
|
||||
include Sidekiq::Worker
|
||||
class FeedInsertWorker < ApplicationWorker
|
||||
include DatabaseHelper
|
||||
|
||||
def perform(status_id, id, type = 'home', options = {})
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class FetchReplyWorker
|
||||
include Sidekiq::Worker
|
||||
class FetchReplyWorker < ApplicationWorker
|
||||
include ExponentialBackoff
|
||||
|
||||
sidekiq_options queue: 'pull', retry: 3
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GenerateAnnualReportWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class GenerateAnnualReportWorker < ApplicationWorker
|
||||
def perform(account_id, year)
|
||||
AnnualReport.new(Account.find(account_id), year).generate
|
||||
rescue ActiveRecord::RecordNotFound, ActiveRecord::RecordNotUnique
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
# NOTE: This is a deprecated worker, only kept to not break ongoing imports
|
||||
# on upgrade. See `Import::RowWorker` for its replacement.
|
||||
|
||||
class Import::RelationshipWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Import::RelationshipWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', retry: 8, dead: false
|
||||
|
||||
def perform(account_id, target_account_uri, relationship, options)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Import::RowWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Import::RowWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', retry: 6, dead: false
|
||||
|
||||
sidekiq_retries_exhausted do |msg, _exception|
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
# NOTE: This is a deprecated worker, only kept to not break ongoing imports
|
||||
# on upgrade. See `ImportWorker` for its replacement.
|
||||
|
||||
class ImportWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class ImportWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', retry: false
|
||||
|
||||
def perform(import_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class LinkCrawlWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class LinkCrawlWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', retry: 0
|
||||
|
||||
def perform(status_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class LocalNotificationWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class LocalNotificationWorker < ApplicationWorker
|
||||
def perform(receiver_account_id, activity_id = nil, activity_class_name = nil, type = nil)
|
||||
if activity_id.nil? && activity_class_name.nil?
|
||||
activity = Mention.find(receiver_account_id)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeWorker
|
||||
include Sidekiq::Worker
|
||||
class MergeWorker < ApplicationWorker
|
||||
include Redisable
|
||||
include DatabaseHelper
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MoveWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class MoveWorker < ApplicationWorker
|
||||
def perform(source_account_id, target_account_id)
|
||||
@source_account = Account.find(source_account_id)
|
||||
@target_account = Account.find(target_account_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MuteWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class MuteWorker < ApplicationWorker
|
||||
def perform(account_id, target_account_id)
|
||||
FeedManager.instance.clear_from_home(Account.find(account_id), Account.find(target_account_id))
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PollExpirationNotifyWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class PollExpirationNotifyWorker < ApplicationWorker
|
||||
sidekiq_options lock: :until_executing
|
||||
|
||||
def perform(poll_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PostProcessMediaWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class PostProcessMediaWorker < ApplicationWorker
|
||||
sidekiq_options retry: 1, dead: false
|
||||
|
||||
sidekiq_retries_exhausted do |msg|
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PublishAnnouncementReactionWorker
|
||||
include Sidekiq::Worker
|
||||
class PublishAnnouncementReactionWorker < ApplicationWorker
|
||||
include Redisable
|
||||
|
||||
def perform(announcement_id, name)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PublishScheduledAnnouncementWorker
|
||||
include Sidekiq::Worker
|
||||
class PublishScheduledAnnouncementWorker < ApplicationWorker
|
||||
include Redisable
|
||||
|
||||
def perform(announcement_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PublishScheduledStatusWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class PublishScheduledStatusWorker < ApplicationWorker
|
||||
sidekiq_options lock: :until_executed, lock_ttl: 1.hour.to_i
|
||||
|
||||
def perform(scheduled_status_id)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PushConversationWorker
|
||||
include Sidekiq::Worker
|
||||
class PushConversationWorker < ApplicationWorker
|
||||
include Redisable
|
||||
|
||||
def perform(conversation_account_id)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PushEncryptedMessageWorker
|
||||
include Sidekiq::Worker
|
||||
class PushEncryptedMessageWorker < ApplicationWorker
|
||||
include Redisable
|
||||
|
||||
def perform(encrypted_message_id)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PushUpdateWorker
|
||||
include Sidekiq::Worker
|
||||
class PushUpdateWorker < ApplicationWorker
|
||||
include Redisable
|
||||
|
||||
def perform(account_id, status_id, timeline_id = nil, options = {})
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RedownloadAvatarWorker
|
||||
include Sidekiq::Worker
|
||||
class RedownloadAvatarWorker < ApplicationWorker
|
||||
include ExponentialBackoff
|
||||
include JsonLdHelper
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RedownloadHeaderWorker
|
||||
include Sidekiq::Worker
|
||||
class RedownloadHeaderWorker < ApplicationWorker
|
||||
include ExponentialBackoff
|
||||
include JsonLdHelper
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RedownloadMediaWorker
|
||||
include Sidekiq::Worker
|
||||
class RedownloadMediaWorker < ApplicationWorker
|
||||
include ExponentialBackoff
|
||||
include JsonLdHelper
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RefollowWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class RefollowWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', retry: false
|
||||
|
||||
def perform(target_account_id)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RegenerationWorker
|
||||
include Sidekiq::Worker
|
||||
class RegenerationWorker < ApplicationWorker
|
||||
include DatabaseHelper
|
||||
|
||||
sidekiq_options lock: :until_executed
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoteAccountRefreshWorker
|
||||
include Sidekiq::Worker
|
||||
class RemoteAccountRefreshWorker < ApplicationWorker
|
||||
include ExponentialBackoff
|
||||
include JsonLdHelper
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemovalWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class RemovalWorker < ApplicationWorker
|
||||
def perform(status_id, options = {})
|
||||
RemoveStatusService.new.call(Status.with_discarded.find(status_id), **options.symbolize_keys)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveFeaturedTagWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class RemoveFeaturedTagWorker < ApplicationWorker
|
||||
def perform(account_id, featured_tag_id)
|
||||
RemoveFeaturedTagService.new.call(Account.find(account_id), FeaturedTag.find(featured_tag_id))
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveFromPublicStatusesIndexWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class RemoveFromPublicStatusesIndexWorker < ApplicationWorker
|
||||
def perform(account_id)
|
||||
account = Account.find(account_id)
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ResolveAccountWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class ResolveAccountWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.day.to_i
|
||||
|
||||
def perform(uri)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::AccountsStatusesCleanupScheduler
|
||||
include Sidekiq::Worker
|
||||
class Scheduler::AccountsStatusesCleanupScheduler < ApplicationWorker
|
||||
include Redisable
|
||||
|
||||
# This limit is mostly to be nice to the fediverse at large and not
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::AutoCloseRegistrationsScheduler
|
||||
include Sidekiq::Worker
|
||||
class Scheduler::AutoCloseRegistrationsScheduler < ApplicationWorker
|
||||
include Redisable
|
||||
|
||||
sidekiq_options retry: 0
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::FollowRecommendationsScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::FollowRecommendationsScheduler < ApplicationWorker
|
||||
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 1.day.to_i
|
||||
|
||||
def perform
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::IndexingScheduler
|
||||
include Sidekiq::Worker
|
||||
class Scheduler::IndexingScheduler < ApplicationWorker
|
||||
include Redisable
|
||||
include DatabaseHelper
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::InstanceRefreshScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::InstanceRefreshScheduler < ApplicationWorker
|
||||
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 1.day.to_i
|
||||
|
||||
def perform
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::IpCleanupScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::IpCleanupScheduler < ApplicationWorker
|
||||
IP_RETENTION_PERIOD = ENV.fetch('IP_RETENTION_PERIOD', 1.year).to_i.seconds.freeze
|
||||
SESSION_RETENTION_PERIOD = ENV.fetch('SESSION_RETENTION_PERIOD', 1.year).to_i.seconds.freeze
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::PgheroScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::PgheroScheduler < ApplicationWorker
|
||||
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 1.day.to_i
|
||||
|
||||
def perform
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::ScheduledStatusesScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::ScheduledStatusesScheduler < ApplicationWorker
|
||||
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 1.hour.to_i
|
||||
|
||||
def perform
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::SelfDestructScheduler
|
||||
include Sidekiq::Worker
|
||||
class Scheduler::SelfDestructScheduler < ApplicationWorker
|
||||
include SelfDestructHelper
|
||||
|
||||
MAX_ENQUEUED = 10_000
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::SoftwareUpdateCheckScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::SoftwareUpdateCheckScheduler < ApplicationWorker
|
||||
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 1.hour.to_i
|
||||
|
||||
def perform
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::SuspendedUserCleanupScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::SuspendedUserCleanupScheduler < ApplicationWorker
|
||||
# Each processed deletion request may enqueue an enormous
|
||||
# amount of jobs in the `pull` queue, so only enqueue when
|
||||
# the queue is empty or close to being so.
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::Trends::RefreshScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::Trends::RefreshScheduler < ApplicationWorker
|
||||
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 30.minutes.to_i
|
||||
|
||||
def perform
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::Trends::ReviewNotificationsScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::Trends::ReviewNotificationsScheduler < ApplicationWorker
|
||||
sidekiq_options retry: 0
|
||||
|
||||
def perform
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::UserCleanupScheduler
|
||||
class Scheduler::UserCleanupScheduler < ApplicationWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
UNCONFIRMED_ACCOUNTS_MAX_AGE_DAYS = 7
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Scheduler::VacuumScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Scheduler::VacuumScheduler < ApplicationWorker
|
||||
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 1.day.to_i
|
||||
|
||||
def perform
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TagUnmergeWorker
|
||||
include Sidekiq::Worker
|
||||
class TagUnmergeWorker < ApplicationWorker
|
||||
include DatabaseHelper
|
||||
|
||||
sidekiq_options queue: 'pull'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ThreadResolveWorker
|
||||
include Sidekiq::Worker
|
||||
class ThreadResolveWorker < ApplicationWorker
|
||||
include ExponentialBackoff
|
||||
|
||||
sidekiq_options queue: 'pull', retry: 3
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TriggerWebhookWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class TriggerWebhookWorker < ApplicationWorker
|
||||
def perform(event, class_name, id)
|
||||
object = class_name.constantize.find(id)
|
||||
WebhookService.new.call(event, object)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UnfavouriteWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class UnfavouriteWorker < ApplicationWorker
|
||||
def perform(account_id, status_id)
|
||||
UnfavouriteService.new.call(Account.find(account_id), Status.find(status_id))
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UnfilterNotificationsWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class UnfilterNotificationsWorker < ApplicationWorker
|
||||
def perform(notification_request_id)
|
||||
@notification_request = NotificationRequest.find(notification_request_id)
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UnfollowFollowWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class UnfollowFollowWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'pull'
|
||||
|
||||
def perform(follower_account_id, old_target_account_id, new_target_account_id, bypass_locked = false)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UnmergeWorker
|
||||
include Sidekiq::Worker
|
||||
class UnmergeWorker < ApplicationWorker
|
||||
include DatabaseHelper
|
||||
|
||||
sidekiq_options queue: 'pull'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UnpublishAnnouncementWorker
|
||||
include Sidekiq::Worker
|
||||
class UnpublishAnnouncementWorker < ApplicationWorker
|
||||
include Redisable
|
||||
|
||||
def perform(announcement_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class VerifyAccountLinksWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class VerifyAccountLinksWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'default', retry: false, lock: :until_executed, lock_ttl: 1.hour.to_i
|
||||
|
||||
def perform(account_id)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Web::PushNotificationWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
class Web::PushNotificationWorker < ApplicationWorker
|
||||
sidekiq_options queue: 'push', retry: 5
|
||||
|
||||
TTL = 48.hours.to_s
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Webhooks::DeliveryWorker
|
||||
include Sidekiq::Worker
|
||||
class Webhooks::DeliveryWorker < ApplicationWorker
|
||||
include JsonLdHelper
|
||||
|
||||
sidekiq_options queue: 'push', retry: 16, dead: false
|
||||
|
|
Loading…
Reference in a new issue