07:18:07
icon

カラオケは行きたいよな

07:25:45
2017-06-04 07:25:45 Posting zunda zundan@mastodon.zunda.ninja
09:09:18
icon

キャッシュをクリアしなければいけない件はすでにIssueとして記録されていた。リリースノートに書かれますように

https://github.com/tootsuite/mastodon/issues/3505#issuecomment-305884125

09:19:52
icon

Merged master at defe4f9bc3407cde4d5b1918778b0754ef7f4970

09:56:43
icon

Mastodonのrake testしたいんだけどコンテナの外でやるのが一般的なんじゃろか?Dockerのどっかでできないじゃろか?

09:59:00
icon

Dockerfileのbundle installには--without test developmentとか書いてあるしね

10:16:52
icon

やーん。

$ npm install yarn
$ PATH=$PATH:$PWD/bin
$ yarn install
Yarn executable was not detected in the system.
Download Yarn at https://yarnpkg.com/en/docs/install

10:25:18
2017-06-04 10:25:18 Posting zunda zundan@mastodon.zunda.ninja
10:53:44
icon

Dockerがいじったツリー、991さんが持ってるファイルが散乱してたりなかなかの状況w

10:56:38
icon

nokogiriビルド (5分ぶり5回目)

11:10:48
icon

Dockerビルドマシンで直接rake specが走るようになりました

https://gist.github.com/zunda/aa6870d0f9f68e705d54d1fa882b0cc0

いやー大変w

Web site image
Mastodonのrspecを走らせられるようにする
13:56:48
icon

Streaming APIのかんさつ

- /web/timelines/publicから読み込まれた/api/v1/streaming/?access_token=********&stream=publicを別のタブから読もうとするとerror: "Error: Missing access token"になる
- /web/timelines/publicをリロードしてもaccess_tokenは変化しない
- クッキーを送らなくても読める
- Acceptリクエストヘッダは必要
- Sec-WebSocket-Versionリクエストヘッダは必要
- Upgradeリクエストヘッダは必要
- Sec-WebSocket-Keyヘッダは必要

13:57:42
icon

というわけで最小のcurlラインは下記のような感じ。

curl 'https://<ホスト名>//api/v1/streaming/?access_token=<トークン>&stream=public' -H 'Host: <ホスト名>' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Sec-WebSocket-Version: 13' -H 'Sec-WebSocket-Key: <キー>==' -H 'Upgrade: websocket’

ログインしていることを証明する必要はないんだねえ

14:11:08
icon

mstdn.jpではすでにリダイレクトができているとのこと https://github.com/tootsuite/mastodon/issues/2068#issuecomment-305960329 なんだけどソースコードどこよーw

Web site image
How to get STREAMING_API_BASE_URL from API? · Issue #2068 · mastodon/mastodon
16:11:02
icon

これが、

Jun 05 02:05:24 zundan-mastodon app/web.1: method=GET path=/api/v1/streaming format=html controller=ApplicationController action=raise_not_found status=404

こうなった!

Jun 05 02:09:39 zundan-mastodon app/web.1: method=GET path=/api/v1/streaming format=html controller=Api::V1::StreamingController action=index status=301 location=https://zundan-mastodon-streaming.herokuapp.com/api/v1/streaming?stream=user&access_token=<deadbeef>

16:14:07
icon

しばらく様子を見て問題がなさそうならPRにしちゃおう♪

16:30:06
2017-06-04 16:30:06 Posting zunda zundan@mastodon.zunda.ninja
16:35:43
icon
Web site image
Redirect to streaming_api_base_url by zunda · Pull Request #3579 · mastodon/mastodon
16:39:04
icon

コード書けるの幸せだけどRailsとかRSpecとかどう書くべきか調べるのにどんどーん時間を取られる。慣れてないからねえ。

17:24:37
icon

Redisならしょうがない(てか有償版高いんすけど…

method=GET path=/api/v1/timelines/home format=html controller=Api::V1::Timelines::HomeController action=show status=500 error='Redis::CommandError: ERR max number of clients reached'

17:26:55
icon

@ykzts おーっ www

17:28:33
icon

# frozen_string_literal: true
してるのに文字列リテラルが一つも無いファイル

18:08:50
icon

あー

さっきのPR、ポート番号どうするんじゃろ…

18:45:45
icon

リモートワークのイベントがあるというので喜んで概要のページを見に行ったらリモート参加できるかどうかはまだわからないってw

19:49:22
icon

Redisどの〜(どこかでスレッド数減らさないとな)

20:04:32
icon

このインスタンスのsidekiqはデフォルトでは5スレッド起動するっぽい

$ sidekiq &
$ ps x
:
13 ? Sl 0:03 sidekiq 5.0.0 app [0 of 5 busy]
:

$ sidekiq -c 3 &
$ ps x
:
49 ? Sl 0:03 sidekiq 5.0.0 app [0 of 3 busy]
:

暇そうだし2スレッドまで減らしてみよう

20:18:42
icon

https://github.com/zunda/mastodon/commit/172349ea67ab4ac34075df26be0441ca861f37f4 な感じにして、

$ heroku config:set SIDEKIQ_THREADS=2 -a zundan-mastodon

こんな感じでどうじゃろ

Web site image
Make number of sidekiq threads configurable · zunda/mastodon@172349e
20:27:25
icon

Sidekiqのスレッド数を3個減らしたらRedisのコネクション数が制限に収まるようになった感じがします。ブラウザもうひとつ起動したら破綻するなw

20:30:30
2017-06-04 20:30:30 Posting zunda zundan@mastodon.zunda.ninja
20:41:12
icon

@hatabowyou おおっと、bootsnapがこちらで試してるのより新しくなってますね。みてみます。

masterは壊れてることもあるので、リリース版(今ならv1.4.1)を試してみるのも良いかもしれません。

git checkout v1.4.1

20:46:06
icon

@hatabowyou バージョンは関係なかったようです。RAILS_ENVを指定しないとエラーが出るようです。

$ RAILS_ENV=production bundle exec rake secret

でいかがでしょう?

20:52:52
icon

カラムが「Pin」になっている時に左右に動かせて「Unpin」になっている時に左右に動かせないの、なんだか論理が逆な気がする。あれれ違うかな?操作のしかたがわからないw

20:54:37
icon

@ykzts Homeがどこか行っちゃいましたw

20:55:16
icon

いちど設定画面に行ったら復活したwww

23:46:48
icon

codeclimateにハッシュの書き方が古いと怒られるおっさん

23:49:01
icon

@hatabowyou プロダクション用のデータベースに触り始めてる感じなので、もしデータがあるのなら消しちゃわないよう注意しつつ、データベースへの接続のためのホスト名とかポート番号とかユーザー名とかパスワードとか、意図どおりに設定されているか確認するといいかもです。