Commit 409bb05a authored by mgabdev's avatar mgabdev

Added update_account_stats function to accounts_cli

• Added:
- update_account_stats function to accounts_cli
parent d01f610d
......@@ -498,6 +498,26 @@ module GabSocial
end
end
desc 'update_account_stats ACCT', 'Update account stats.'
long_desc <<-LONG_DESC
Update account stats (follow count, status count, following count).
LONG_DESC
def update_account_stats(acct)
target_account = Account.find(acct)
if target_account.nil?
say("Target account (#{acct}) was not found", :red)
exit(1)
end
AccountStat.where(account: target_account).update(
followers_count: target_account.local_followers_count,
following_count: target_account.local_following_count,
statuses_count: target_account.statuses.count,
)
say('OK', :green)
end
private
def rotate_keys_for_account(account, delay = 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment