[Groonga-commit] droonga/droonga-engine at 911a91f [master] Use Timestamp module to format timestamp to string

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 28 22:57:23 JST 2015


YUKI Hiroshi	2015-04-28 22:57:23 +0900 (Tue, 28 Apr 2015)

  New Revision: 911a91f6fda8cd065b56c3116bdea1bfbc718a74
  https://github.com/droonga/droonga-engine/commit/911a91f6fda8cd065b56c3116bdea1bfbc718a74

  Message:
    Use Timestamp module to format timestamp to string

  Modified files:
    lib/droonga/buffered_tcp_socket.rb
    lib/droonga/forward_buffer.rb
    lib/droonga/handler_messenger.rb

  Modified: lib/droonga/buffered_tcp_socket.rb (+2 -3)
===================================================================
--- lib/droonga/buffered_tcp_socket.rb    2015-04-28 22:56:12 +0900 (6e74a49)
+++ lib/droonga/buffered_tcp_socket.rb    2015-04-28 22:57:23 +0900 (3ebc3b8)
@@ -18,6 +18,7 @@
 require "coolio"
 
 require "droonga/loggable"
+require "droonga/timestamp"
 
 module Droonga
   class BufferedTCPSocket < Coolio::TCPSocket
@@ -158,14 +159,12 @@ module Droonga
       end
 
       private
-      MICRO_SECONDS_DECIMAL_PLACE = 6
-
       def path
         @path ||= create_chunk_file_path
       end
 
       def create_chunk_file_path
-        basename = @time_stamp.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE)
+        basename = Timestamp.stringify(@time_stamp)
         if @uniqueness
           @data_directory + "#{basename}.#{@uniqueness}.#{@revision}#{SUFFIX}"
         else

  Modified: lib/droonga/forward_buffer.rb (+2 -3)
===================================================================
--- lib/droonga/forward_buffer.rb    2015-04-28 22:56:12 +0900 (8b4e394)
+++ lib/droonga/forward_buffer.rb    2015-04-28 22:57:23 +0900 (753426d)
@@ -24,6 +24,7 @@ require "droonga/loggable"
 require "droonga/path"
 require "droonga/safe_file_writer"
 require "droonga/serf"
+require "droonga/timestamp"
 
 module Droonga
   class ForwardBuffer
@@ -141,10 +142,8 @@ module Droonga
       forwarded
     end
 
-    MICRO_SECONDS_DECIMAL_PLACE = 6
-
     def create_buffered_message_path(time_stamp=Time.now)
-      basename = time_stamp.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE)
+      basename = Timestamp.stringify(time_stamp)
       Path.unique_file_path(@data_directory, basename, SUFFIX)
     end
 

  Modified: lib/droonga/handler_messenger.rb (+2 -3)
===================================================================
--- lib/droonga/handler_messenger.rb    2015-04-28 22:56:12 +0900 (26d5069)
+++ lib/droonga/handler_messenger.rb    2015-04-28 22:57:23 +0900 (a160099)
@@ -17,6 +17,7 @@ require "time"
 
 require "droonga/replier"
 require "droonga/forwarder"
+require "droonga/timestamp"
 
 module Droonga
   class HandlerMessenger
@@ -121,10 +122,8 @@ module Droonga
       "[#{Process.ppid}] handler_messenger"
     end
 
-    MICRO_SECONDS_DECIMAL_PLACE = 6
-
     def new_date
-      Time.now.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE)
+      Timestamp.stringify(Time.now)
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Télécharger 



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