Browse Source

Fix slow fallback of CopyAccountStats migration setting stats to 0 (#9930)

Eugen Rochko 4 months ago
parent
commit
5d312ef9c7
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      db/migrate/20181116173541_copy_account_stats.rb

+ 1
- 1
db/migrate/20181116173541_copy_account_stats.rb View File

@@ -44,7 +44,7 @@ class CopyAccountStats < ActiveRecord::Migration[5.2]
44 44
     # uniqueness violations that we need to skip over
45 45
     Account.unscoped.select('id, statuses_count, following_count, followers_count, created_at, updated_at').find_each do |account|
46 46
       begin
47
-        params = [[nil, account.id], [nil, account.statuses_count], [nil, account.following_count], [nil, account.followers_count], [nil, account.created_at], [nil, account.updated_at]]
47
+        params = [[nil, account.id], [nil, account[:statuses_count]], [nil, account[:following_count]], [nil, account[:followers_count]], [nil, account.created_at], [nil, account.updated_at]]
48 48
         exec_insert('INSERT INTO account_stats (account_id, statuses_count, following_count, followers_count, created_at, updated_at) VALUES ($1, $2, $3, $4, $5, $6)', nil, params)
49 49
       rescue ActiveRecord::RecordNotUnique
50 50
         next

Loading…
Cancel
Save