allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/7] git commit: [#7316] speed up setup-app command be restoring trove event bypass from [4a9c344]
Date Thu, 08 May 2014 14:44:40 GMT
Repository: allura
Updated Branches:
  refs/heads/master 8cf970b34 -> 274584458


[#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/f35aadd3
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/f35aadd3
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/f35aadd3

Branch: refs/heads/master
Commit: f35aadd37028e48d79765023d5a1dd3d069dbbd2
Parents: 515d18d
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Apr 16 17:17:17 2014 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Thu May 8 10:44:08 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/f35aadd3/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