[Groonga-commit] droonga/express-droonga at 00e5487 [master] Recognize "ttl" option as a number in milliseconds, insead of seconds.

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Mar 20 14:12:47 JST 2014


YUKI Hiroshi	2014-03-20 14:12:47 +0900 (Thu, 20 Mar 2014)

  New Revision: 00e5487e2985e55ca96251fefa25b8810f9fa7d4
  https://github.com/droonga/express-droonga/commit/00e5487e2985e55ca96251fefa25b8810f9fa7d4

  Message:
    Recognize "ttl" option as a number in milliseconds, insead of seconds.
    
    Because uber-cache's TTL is defined in milliseconds.

  Modified files:
    lib/response-cache.js

  Modified: lib/response-cache.js (+3 -4)
===================================================================
--- lib/response-cache.js    2014-03-20 14:12:08 +0900 (fd715ee)
+++ lib/response-cache.js    2014-03-20 14:12:47 +0900 (c793ae5)
@@ -8,10 +8,9 @@ function normalizeOptions(options) {
 
   options.size = options.size || defaultSie;
 
-  var ttlInSeconds = options.ttl ||
-                       options.ttlInSeconds ||
-                       0;
-  options.ttlInMilliSeconds = options.ttlInMilliSeconds ||
+  var ttlInSeconds = options.ttlInSeconds || 0;
+  options.ttlInMilliSeconds = options.ttl ||
+                                options.ttlInMilliSeconds ||
                                 (ttlInSeconds * 1000) ||
                                 defaultTTLInMilliSeconds;
 
-------------- next part --------------
HTML����������������������������...
Download 



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