[Groonga-commit] groonga/groonga-admin at 4b27365 [master] Set thread_limit to 1 while getting schema

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Sep 26 11:15:17 JST 2016


YUKI Hiroshi	2016-09-26 11:15:17 +0900 (Mon, 26 Sep 2016)

  New Revision: 4b27365f0302169ce410d2c86857767ceb612590
  https://github.com/groonga/groonga-admin/commit/4b27365f0302169ce410d2c86857767ceb612590

  Merged 9791dae: Merge pull request #14 from groonga/features/set-thread-limit-to-1

  Message:
    Set thread_limit to 1 while getting schema

  Modified files:
    app/scripts/services/schema-loader.js

  Modified: app/scripts/services/schema-loader.js (+27 -1)
===================================================================
--- app/scripts/services/schema-loader.js    2016-09-26 11:05:41 +0900 (3dc3ce3)
+++ app/scripts/services/schema-loader.js    2016-09-26 11:15:17 +0900 (d56681f)
@@ -188,11 +188,37 @@ angular.module('groongaAdminApp')
 
       function fetchSchema(schema) {
         schema.tables = {};
-        return client.execute('schema')
+        var lastMaxLimit;
+        return client.execute('thread_limit', { max: 1 })
+          .success(function(response) {
+            lastMaxLimit = response.lastMaxLimit();
+          })
+          .error(function() {
+          })
+          .then(function() {
+            return client.execute('schema')
           .success(function(response) {
             schema.types = buildTypes(response.types());
             schema.tables = buildTables(response.tables());
             resolveIndexes(schema);
+            return schema;
+          })
+            .error(function() {
+              return null;
+            });
+          })
+          .then(function(schema) {
+            if (!lastMaxLimit)
+              return schema;
+            return client.execute('thread_limit', { max: lastMaxLimit })
+                    .success(function(response) {
+                      return schema;
+                    })
+                    .error(function() {
+                      return schema;
+                    });
+          })
+          .then(function(schema) {
             fetched = true;
             fetching = false;
             waitingDeferes.forEach(function(defer) {
-------------- next part --------------
HTML����������������������������...
Download 



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