[Groonga-commit] droonga/droonga-engine at 643fa3a [master] Use meaningful variable name

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Apr 23 16:57:08 JST 2015


YUKI Hiroshi	2015-04-23 16:57:08 +0900 (Thu, 23 Apr 2015)

  New Revision: 643fa3a4292a85103da34fc5adfaa8e24c093581
  https://github.com/droonga/droonga-engine/commit/643fa3a4292a85103da34fc5adfaa8e24c093581

  Message:
    Use meaningful variable name

  Modified files:
    lib/droonga/file_observer.rb

  Modified: lib/droonga/file_observer.rb (+7 -10)
===================================================================
--- lib/droonga/file_observer.rb    2015-04-23 16:55:05 +0900 (8561bea)
+++ lib/droonga/file_observer.rb    2015-04-23 16:57:08 +0900 (df46455)
@@ -39,28 +39,25 @@ module Droonga
     end
 
     def start
-      @watcher = Coolio::TimerWatcher.new(CHECK_INTERVAL, true)
-      on_timer = lambda do
+      @timer = Coolio::TimerWatcher.new(CHECK_INTERVAL, true)
+      @timer.on_timer do
         if updated?
           @mtime =****@path*****
           on_change
         end
       end
-      @watcher.on_timer do
-        on_timer.call
-      end
-      @loop.attach(@watcher)
+      @loop.attach(@timer)
       # logger.trace("start: new file watcher attached",
-      #              :watcher => @watcher,
+      #              :watcher => @timer,
       #              :path => @path)
     end
 
     def stop
-      @watcher.detach
+      @timer.detach if @timer
       # logger.trace("stop: file watcher detached",
-      #              :watcher => @watcher,
+      #              :watcher => @timer,
       #              :path => @path)
-      @watcher = nil
+      @timer = nil
     end
 
     private
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index