QueueStatusServer crashes in production on next-patch
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2013 05:49:31 +0000 (05:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2013 05:49:31 +0000 (05:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107775

Patch by Alan Cutter <alancutter@chromium.org> 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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140652 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/QueueStatusServer/app.yaml
Tools/QueueStatusServer/model/patchlog.py

index 97a5364..318c06e 100644 (file)
@@ -1,3 +1,19 @@
+2013-01-23  Alan Cutter  <alancutter@chromium.org>
+
+        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  <rniwa@webkit.org>
 
         The previous patch wasn't complete. Finish reverting r139998 for real.
index 35b4ed5..1019461 100644 (file)
@@ -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
 
index fbb986e..ccdbef2 100644 (file)
@@ -49,9 +49,14 @@ class PatchLog(db.Model):
 
     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