Просмотр исходного кода

Fix activity:interactions counter to count all interactions (#8037)

master
Eugen Rochko 5 лет назад
committed by GitHub
Родитель
Сommit
a23ac107e4
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 4AEE18F83AFDEB23
4 измененных файлов: 5 добавлений и 3 удалений
  1. +0
    -2
      app/lib/potential_friendship_tracker.rb
  2. +1
    -0
      app/services/favourite_service.rb
  3. +3
    -1
      app/services/post_status_service.rb
  4. +1
    -0
      app/services/reblog_service.rb

+ 0
- 2
app/lib/potential_friendship_tracker.rb Просмотреть файл

@@ -20,8 +20,6 @@ class PotentialFriendshipTracker
redis.zincrby(key, weight, target_account_id)
redis.zremrangebyrank(key, 0, -MAX_ITEMS)
redis.expire(key, EXPIRE_AFTER)

ActivityTracker.increment('activity:interactions')
end

def remove(account_id, target_account_id)


+ 1
- 0
app/services/favourite_service.rb Просмотреть файл

@@ -37,6 +37,7 @@ class FavouriteService < BaseService
end

def bump_potential_friendship(account, status)
ActivityTracker.increment('activity:interactions')
return if account.following?(status.account_id)
PotentialFriendshipTracker.record(account.id, status.account_id, :favourite)
end


+ 3
- 1
app/services/post_status_service.rb Просмотреть файл

@@ -83,7 +83,9 @@ class PostStatusService < BaseService
end

def bump_potential_friendship(account, status)
return if !status.reply? || account.following?(status.in_reply_to_account_id)
return if !status.reply? || account.id == status.in_reply_to_account_id
ActivityTracker.increment('activity:interactions')
return if account.following?(status.in_reply_to_account_id)
PotentialFriendshipTracker.record(account.id, status.in_reply_to_account_id, :reply)
end
end

+ 1
- 0
app/services/reblog_service.rb Просмотреть файл

@@ -44,6 +44,7 @@ class ReblogService < BaseService
end

def bump_potential_friendship(account, reblog)
ActivityTracker.increment('activity:interactions')
return if account.following?(reblog.reblog.account_id)
PotentialFriendshipTracker.record(account.id, reblog.reblog.account_id, :reblog)
end


Загрузка…
Отмена
Сохранить