提交 1f5e21bc 编写于 作者: R Ryuta Kamizono

Remove redundant begin block

We enabled `Style/RedundantBegin` cop at #34764, but it is hard to
detect an offence if returning value put after the block.
上级 5754a29a
......@@ -64,13 +64,10 @@ def read_from_replica(&blk)
def write_to_primary(&blk)
ActiveRecord::Base.connected_to(role: :writing) do
instrumenter.instrument("database_selector.active_record.wrote_to_primary") do
begin
ret = yield
yield
ensure
resolver.update_last_write_timestamp
end
ret
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册