This account is not set to public on notestock.
This account is not set to public on notestock.
$ heroku pg:info
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 259.9 MB
Tables: 34
Rows: 508370/10000000 (In compliance) - refreshing
Api::V1::InstancesController#showはinstance_presenter.rbでRails.cache.fetchが効いてるのか定期的にだけ遅いんだねw https://mastodon.zunda.ninja/media/N3NI0mWS5u5pqtN213g
Rails.cache.fetch、有効期限を指定できるんだ!
http://guides.rubyonrails.org/caching_with_rails.html#low-level-caching
http://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html#method-i-fetch
イニシャライザでキャッシュの有効期限をぐーんと延長してみました。Dynoが起動して最初にシーケンシャルスキャンをしたらあとは次の起動までしなくていいはず(その分情報は古くなるよ)
$ heroku run bash
~ $ rails c
> MAX_CACHE_AGE = 36.hours
> Rails.cache.fetch('local_status_count', expires_in: MAX_CACHE_AGE) { Status.local.count }
=> 3695
> Rails.cache.fetch('local_status_count', force: true) { Status.local.count }
=> 3699
うむ
@t_trace さんの「巨象の肩に乗って」が載ってる小説現代8月号をやっと買ったよ!Kindle版だと絵のあるページは画像になっててなんだか読みにくいけれど、文章ばかりのページは問題なさそう。
http://shousetsu-gendai.kodansha.co.jp/latest/201708.html
https://www.amazon.co.jp/dp/B0749L85SZ
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.
あれよという間に読んじゃいました。つ、つづきが、よみたい!
…と感じさせながら終わってるのが良いんだろうな。一眠りしたらコード触ろっと。