Upgrade to latest redis-rb 4.x and fix deprecations (#23616)
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
This commit is contained in:
parent
aa98c8fbeb
commit
922837dc96
11 changed files with 37 additions and 38 deletions
|
@ -1,6 +1,6 @@
|
|||
class FixReblogsInFeeds < ActiveRecord::Migration[5.1]
|
||||
def up
|
||||
redis = Redis.current
|
||||
redis = RedisConfiguration.pool.checkout
|
||||
fm = FeedManager.instance
|
||||
|
||||
# Old scheme:
|
||||
|
|
|
@ -2,7 +2,8 @@ class MigrateUnavailableInboxes < ActiveRecord::Migration[5.2]
|
|||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
urls = Redis.current.smembers('unavailable_inboxes')
|
||||
redis = RedisConfiguration.pool.checkout
|
||||
urls = redis.smembers('unavailable_inboxes')
|
||||
|
||||
hosts = urls.map do |url|
|
||||
Addressable::URI.parse(url).normalized_host
|
||||
|
@ -14,7 +15,7 @@ class MigrateUnavailableInboxes < ActiveRecord::Migration[5.2]
|
|||
UnavailableDomain.create(domain: host)
|
||||
end
|
||||
|
||||
Redis.current.del(*(['unavailable_inboxes'] + Redis.current.keys('exhausted_deliveries:*')))
|
||||
redis.del(*(['unavailable_inboxes'] + redis.keys('exhausted_deliveries:*')))
|
||||
end
|
||||
|
||||
def down; end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue