Kouhei Sutou
kou****@clear*****
Tue Apr 28 18:28:10 JST 2015
> + unless @last_message_timestamp > + @last_message_timestamp = read_last_message_timestamp > + end こういうときは @last_message_timestamp ||= read_last_message_timestamp と書くといいですよ。 In <f859a625d27b26f6931f7f61285993483f04d88a �� jenkins.clear-code.com> "[Groonga-commit] droonga/droonga-engine �� f859a62 [master] Load last processed timetamp from file for newly started process" on Tue, 28 Apr 2015 18:19:50 +0900, YUKI Hiroshi <null+groonga �� clear-code.com> wrote: > YUKI Hiroshi 2015-04-28 18:19:50 +0900 (Tue, 28 Apr 2015) > > New Revision: f859a625d27b26f6931f7f61285993483f04d88a > https://github.com/droonga/droonga-engine/commit/f859a625d27b26f6931f7f61285993483f04d88a > > Message: > Load last processed timetamp from file for newly started process > > Modified files: > lib/droonga/engine.rb > > Modified: lib/droonga/engine.rb (+3 -0) > =================================================================== > --- lib/droonga/engine.rb 2015-04-28 18:08:23 +0900 (196ce38) > +++ lib/droonga/engine.rb 2015-04-28 18:19:50 +0900 (b3716a4) > @@ -146,6 +146,9 @@ module Droonga > > def export_last_message_timestamp_to_cluster > logger.trace("export_last_message_timestamp_to_cluster: start") > + unless @last_message_timestamp > + @last_message_timestamp = read_last_message_timestamp > + end > if @last_message_timestamp > timestamp = @last_message_timestamp > serf = Serf.new(@name)