diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-03-22 19:50:11 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-03-22 19:50:11 +0100 |
commit | 5ac380c1226a8225a84835f6c70b7bdf00f99fb2 (patch) | |
tree | 432e2dce315060938ecc0ba05a9ae20fdb1da2d7 /lib | |
parent | 02ac94490a67659c7cc669ead5b107b724db6e68 (diff) | |
parent | 2626097869c9520c21aaba73c9bcfe72c0f25f28 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/models/status.rb`: Upstream added lines close to a glitch-soc only line, not a real conflict. Applied upstream's changes (added hooks) while keeping glitch-soc's changes (`local_only` scope). - `config/environments/production.rb`: Upstream removed a header, while we have glitch-soc specific ones. Removed the header removed upstream.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mastodon/cli_helper.rb | 16 | ||||
-rw-r--r-- | lib/mastodon/version.rb | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/mastodon/cli_helper.rb b/lib/mastodon/cli_helper.rb index 8704edd75..ab1351ae8 100644 --- a/lib/mastodon/cli_helper.rb +++ b/lib/mastodon/cli_helper.rb @@ -52,14 +52,16 @@ module Mastodon progress.log("Processing #{item.id}") if options[:verbose] - result = ActiveRecord::Base.connection_pool.with_connection do - yield(item) - ensure - RedisConfiguration.pool.checkin if Thread.current[:redis] - Thread.current[:redis] = nil + Chewy.strategy(:mastodon) do + result = ActiveRecord::Base.connection_pool.with_connection do + yield(item) + ensure + RedisConfiguration.pool.checkin if Thread.current[:redis] + Thread.current[:redis] = nil + end + + aggregate.increment(result) if result.is_a?(Integer) end - - aggregate.increment(result) if result.is_a?(Integer) rescue => e progress.log pastel.red("Error processing #{item.id}: #{e}") ensure diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 3ec546fa2..b98095fa3 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -13,7 +13,7 @@ module Mastodon end def patch - 0 + 1 end def flags |