Title: [140652] trunk/Tools
Revision
140652
Author
[email protected]
Date
2013-01-23 21:49:31 -0800 (Wed, 23 Jan 2013)

Log Message

QueueStatusServer crashes in production on next-patch
https://bugs.webkit.org/show_bug.cgi?id=107775

Patch by Alan Cutter <[email protected]> on 2013-01-23
Reviewed by Adam Barth.

Replaced Python 2.5 incompatible call to timedelta.total_seconds().

* QueueStatusServer/app.yaml:
* QueueStatusServer/model/patchlog.py:
(PatchLog.calculate_wait_duration):
(PatchLog.calculate_process_duration):
(PatchLog):
(PatchLog._time_delta_to_seconds):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (140651 => 140652)


--- trunk/Tools/ChangeLog	2013-01-24 05:48:35 UTC (rev 140651)
+++ trunk/Tools/ChangeLog	2013-01-24 05:49:31 UTC (rev 140652)
@@ -1,3 +1,19 @@
+2013-01-23  Alan Cutter  <[email protected]>
+
+        QueueStatusServer crashes in production on next-patch
+        https://bugs.webkit.org/show_bug.cgi?id=107775
+
+        Reviewed by Adam Barth.
+
+        Replaced Python 2.5 incompatible call to timedelta.total_seconds().
+
+        * QueueStatusServer/app.yaml:
+        * QueueStatusServer/model/patchlog.py:
+        (PatchLog.calculate_wait_duration):
+        (PatchLog.calculate_process_duration):
+        (PatchLog):
+        (PatchLog._time_delta_to_seconds):
+
 2013-01-23  Ryosuke Niwa  <[email protected]>
 
         The previous patch wasn't complete. Finish reverting r139998 for real.

Modified: trunk/Tools/QueueStatusServer/app.yaml (140651 => 140652)


--- trunk/Tools/QueueStatusServer/app.yaml	2013-01-24 05:48:35 UTC (rev 140651)
+++ trunk/Tools/QueueStatusServer/app.yaml	2013-01-24 05:49:31 UTC (rev 140652)
@@ -1,5 +1,5 @@
 application: webkit-commit-queue
-version: 107612 # Bugzilla bug ID of last major change
+version: 107775 # Bugzilla bug ID of last major change
 runtime: python
 api_version: 1
 

Modified: trunk/Tools/QueueStatusServer/model/patchlog.py (140651 => 140652)


--- trunk/Tools/QueueStatusServer/model/patchlog.py	2013-01-24 05:48:35 UTC (rev 140651)
+++ trunk/Tools/QueueStatusServer/model/patchlog.py	2013-01-24 05:49:31 UTC (rev 140652)
@@ -49,9 +49,14 @@
 
     def calculate_wait_duration(self):
         time_delta = datetime.utcnow() - self.date
-        self.wait_duration = int(time_delta.total_seconds())
+        self.wait_duration = int(self._time_delta_to_seconds(time_delta))
 
     def calculate_process_duration(self):
         if self.wait_duration:
             time_delta = datetime.utcnow() - self.date
-            self.process_duration = int(time_delta.total_seconds()) - self.wait_duration
+            self.process_duration = int(self._time_delta_to_seconds(time_delta)) - self.wait_duration
+
+    # Needed to support Python 2.5's lack of timedelta.total_seconds().
+    @classmethod
+    def _time_delta_to_seconds(cls, time_delta):
+        return time_delta.seconds + time_delta.days * 24 * 3600
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to