allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#7316] speed up setup-app command be restoring trove event bypass from [4a9c344]
Date Wed, 16 Apr 2014 21:17:47 GMT
Repository: allura
Updated Branches:
  refs/heads/db/7316 256123021 -> 136e91de7


[#7316] speed up setup-app command be restoring trove event bypass from [4a9c344]


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/136e91de
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/136e91de
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/136e91de

Branch: refs/heads/db/7316
Commit: 136e91de7e015bfc3cd630fd5241bcc79803b80f
Parents: 2561230
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Apr 16 17:17:17 2014 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed Apr 16 17:17:17 2014 -0400

----------------------------------------------------------------------
 Allura/allura/command/create_trove_categories.py | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/136e91de/Allura/allura/command/create_trove_categories.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/create_trove_categories.py b/Allura/allura/command/create_trove_categories.py
index 39c49fe..e520214 100644
--- a/Allura/allura/command/create_trove_categories.py
+++ b/Allura/allura/command/create_trove_categories.py
@@ -18,7 +18,9 @@
 import re
 import sys
 import logging
+
 from ming.orm import session
+from mock import patch, Mock
 
 from . import base
 
@@ -63,6 +65,10 @@ class CreateTroveCategoriesCommand(base.Command):
         for k, v in attr_dict.iteritems():
             setattr(t, k, v)
 
+    # patching to avoid a *lot* of event hooks firing, and taking a long long time
+    @patch.object(M.project.TroveCategoryMapperExtension, 'after_insert', Mock())
+    @patch.object(M.project.TroveCategoryMapperExtension, 'after_update', Mock())
+    @patch.object(M.project.TroveCategoryMapperExtension, 'after_delete', Mock())
     def command(self):
         self.basic_setup()
         M.TroveCategory.query.remove()


Mime
View raw message