Browse Source

Fix migration 20200407202420_migrate_unavailable_inboxes (#13481)

closed-social-v3
Takeshi Umeda 4 years ago
committed by GitHub
parent
commit
ea200a178e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      db/migrate/20200407202420_migrate_unavailable_inboxes.rb

+ 7
- 2
db/migrate/20200407202420_migrate_unavailable_inboxes.rb View File

@ -4,8 +4,13 @@ class MigrateUnavailableInboxes < ActiveRecord::Migration[5.2]
def up
urls = Redis.current.smembers('unavailable_inboxes')
urls.each do |url|
host = Addressable::URI.parse(url).normalized_host
hosts = urls.map do |url|
Addressable::URI.parse(url).normalized_host
end.compact.uniq
UnavailableDomain.delete_all
hosts.each do |host|
UnavailableDomain.create(domain: host)
end

Loading…
Cancel
Save