-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] redisによるsequencerを追加 #5
base: tiepadrino
Are you sure you want to change the base?
Conversation
spec/spec_helper.rb
Outdated
@@ -24,3 +24,5 @@ | |||
config.before(:each) do | |||
end | |||
end | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙄
良さそうに思えた!(変な空白ラインの差分以外は) |
README.rdoc
Outdated
seq_type: redis | ||
connection: redis_sequencer # <-- redis sequencer name | ||
shards: | ||
- connection: redis_shard_1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一瞬各shard DBもredisにできるのかのように見えますね
@seq_shard = SeqShard.new(seq) | ||
seq = (@options[:seq] || @config[:seq]) | ||
if seq | ||
if seq.values.size > 0 && seq.values.first["seq_type"] == "mysql" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seq_type無指定の時はmysqlのようですので、
その場合も@seq_shardにセットする必要がありそうです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/drecom/activerecord-turntable/pull/28/files#diff-aa73b66f1c9647a7824bb29f250b55e8R49
とかみても、
seqはそもそもconfig/turntable.ymlではhash想定?なので、
seq["seq_type"]を評価する必要ありそうです。
seq = (@options[:seq] || @config[:seq]) | ||
if seq | ||
if seq.values.size > 0 && seq.values.first["seq_type"] == "mysql" | ||
@seq_shard = SeqShard.new(seq.values.first) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
をみると、hashを期待しているようなので、
seqをわたせばよさそうです。
redisを利用したsequencerを追加します
修正点/特記事項