kancolle0428 / mastodon

A GNU Social-compatible microblogging server
https://mastodon.social
GNU Affero General Public License v3.0
0 stars 0 forks source link

サーバー情報ページのユーザー数、トゥート数が増えない #5

Open kancolle0428 opened 7 years ago

kancolle0428 commented 7 years ago

https://kancolle-yokosuka.xyz/about/more

chase0213 commented 7 years ago

Inspector

The number of toots is shown by an instance variable @instance_presenter as follows: https://github.com/kancolle0428/mastodon/blob/master/app/views/about/more.html.haml#L34

On the other hand, the variable is set by about_controller.

Finally, the InstancePresenter class is defined in https://github.com/kancolle0428/mastodon/blob/master/app/presenters/instance_presenter.rb

The main logic of status counter is in these lines:

  def status_count
    Rails.cache.fetch('local_status_count') { Status.local.count }
  end

Conclusion

You might see the count twice in a short time, or cache structure might be broken (sounds rare because some values are shown, so far).

kancolle0428 commented 7 years ago

さっき試しにデプロイしたら数値が更新された。しかし相変わらずリアルタイムでカウントが増えていかないので、 サーバー側でキャッシュして更新されないようになっているのかも??

chase0213 commented 7 years ago

It seems like cache hasn't been expired while the settings for it had been written inconfig/initializers/redis.rb. Failing to configure redis?

kancolle0428 commented 7 years ago

本来のキャッシュ保持は10分なんだけどなあ。。redisの設定ミスってるとかだとしたらお手上げですね