Merge commit '9e0a3aaf08e7d4fc700f7f19d61f5f8fee346b6a' into glitch-soc/merge-upstream
This commit is contained in:
commit
89c2ac444f
111 files changed
+891
-238
No files matched your search
@@ -11,18 +11,17 @@ module Mastodon::CLI
|
||||
option :verbose, type: :boolean, aliases: [:v]
|
||||
option :dry_run, type: :boolean, default: false
|
||||
option :link, type: :boolean, default: false
|
||||
desc 'remove', 'Remove preview cards'
|
||||
desc 'remove', 'Remove preview card media'
|
||||
long_desc <<-DESC
|
||||
Removes local thumbnails for preview cards.
|
||||
|
||||
The --days option specifies how old preview cards have to be before
|
||||
they are removed. It defaults to 180 days. Since preview cards will
|
||||
not be re-fetched unless the link is re-posted after 2 weeks from
|
||||
last time, it is not recommended to delete preview cards within the
|
||||
last 14 days.
|
||||
The --days option sets the age a preview card must be before attached
|
||||
media will be removed. Preview cards will not be re-fetched unless the
|
||||
link is posted again two weeks after the last usage, so it is not
|
||||
recommended to delete preview card media from within the last 14 days.
|
||||
|
||||
With the --link option, only link-type preview cards will be deleted,
|
||||
leaving video and photo cards untouched.
|
||||
With the --link option, only media from link-type preview cards will be
|
||||
deleted, skipping video and photo cards.
|
||||
DESC
|
||||
def remove
|
||||
time_ago = options[:days].days.ago
|
||||
@@ -44,7 +43,7 @@ module Mastodon::CLI
|
||||
size
|
||||
end
|
||||
|
||||
say("Removed #{processed} #{link}preview cards (approx. #{number_to_human_size(aggregate)})#{dry_run_mode_suffix}", :green, true)
|
||||
say("Removed media from #{processed} #{link}preview cards (approx. #{number_to_human_size(aggregate)})#{dry_run_mode_suffix}", :green, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -34,7 +34,7 @@ class Mastodon::SidekiqMiddleware
|
||||
# and each such client manages its long-lasting connection to
|
||||
# Elasticsearch.
|
||||
#
|
||||
# As far as I know, neither `chewy`, `elasticsearch-transport` or even
|
||||
# As far as I know, neither `chewy`, `elastic-transport` or even
|
||||
# `faraday` provide a reliable way to immediately close a connection, and
|
||||
# rely on the underlying object to be garbage-collected instead.
|
||||
#
|
||||
@@ -44,7 +44,7 @@ class Mastodon::SidekiqMiddleware
|
||||
def clean_up_elasticsearch_connections!
|
||||
return unless Chewy.enabled? && Chewy.current[:chewy_client].present?
|
||||
|
||||
Chewy.client.transport.transport.connections.each do |connection|
|
||||
Chewy.client.transport.connections.each do |connection|
|
||||
# NOTE: This bit of code is tailored for the HTTPClient Faraday adapter
|
||||
connection.connection.app.instance_variable_get(:@client)&.reset_all
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user