[Groonga-commit] droonga/droonga-http-server at e9f8ce2 [master] Follow API change in express-droonga

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Apr 7 13:19:43 JST 2014


Kouhei Sutou	2014-04-07 13:19:43 +0900 (Mon, 07 Apr 2014)

  New Revision: e9f8ce2e517d2b1052282b9da0ee42a1b9d52d0a
  https://github.com/droonga/droonga-http-server/commit/e9f8ce2e517d2b1052282b9da0ee42a1b9d52d0a

  Message:
    Follow API change in express-droonga

  Modified files:
    bin/droonga-http-server

  Modified: bin/droonga-http-server (+21 -7)
===================================================================
--- bin/droonga-http-server    2014-04-07 11:33:06 +0900 (916bdc6)
+++ bin/droonga-http-server    2014-04-07 13:19:43 +0900 (0cd0c1b)
@@ -44,13 +44,27 @@ application.configure(function() {
     store:  sessionStore
   }));
   application.use(responseTime());
-  if (droonga.cache && options.cacheSize > 0) {
-    application.use(droonga.cache({
-      size: options.cacheSize,
-      rules: [
-        { regex: /./ }
-      ]
-    }));
+  if (options.cacheSize > 0) {
+    var cacheMiddlewareRules = [
+      { regex: /./ }
+    ];
+    if (droonga.Cache) {
+      var cache = new droonga.Cache({
+        size: options.cacheSize,
+      });
+      application.use("/cache/statistics",
+                      droonga.middleware.cacheStatistics(cache));
+      application.use(droonga.middleware.cache(cache, {
+        rules: cacheMiddlewareRules
+      }));
+    } else if (droonga.cache) {
+      // TODO: Remove me when express-droonga 1.0.2 is released and
+      // droonga-http-server requires express-droonga 1.0.2 or later.
+      application.use(droonga.cache({
+        size: options.cacheSize,
+        rules: cacheMiddlewareRules,
+      }));
+    }
   }
 });
 
-------------- next part --------------
HTML����������������������������...
Download 



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