damned-lies r1235 - in trunk: . stats



Author: stephaner
Date: Mon Dec 22 13:52:50 2008
New Revision: 1235
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1235&view=rev

Log:
2008-12-22  StÃphane Raimbault  <stephane raimbault gmail com>

	* stats/models.py: New boolean argument to disable the update of
	statistics at Branch saving.


Modified:
   trunk/ChangeLog
   trunk/stats/models.py

Modified: trunk/stats/models.py
==============================================================================
--- trunk/stats/models.py	(original)
+++ trunk/stats/models.py	Mon Dec 22 13:52:50 2008
@@ -143,11 +143,12 @@
     def __unicode__(self):
         return "%s (%s)" % (self.name, self.module)
 
-    def save(self, force_insert=False, force_update=False):
+    def save(self, force_insert=False, force_update=False, update_statistics=True):
         super(Branch, self).save(force_insert, force_update)
-        # The update command is launched asynchronously in a separate thread
-        upd_thread = threading.Thread(target=self.update_stats, kwargs={'force':True})
-        upd_thread.start()
+        if update_statistics:
+            # The update command is launched asynchronously in a separate thread
+            upd_thread = threading.Thread(target=self.update_stats, kwargs={'force':True})
+            upd_thread.start()
     
     def delete(self):
         # Remove the repo checkout



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]