diff mbox

[Branch,~linaro-validation/lava-scheduler/trunk] Rev 85: work around django bug that meant start_time was usually wrong on job page

Message ID 20111017235713.19659.83630.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson Oct. 17, 2011, 11:57 p.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-scheduler/workaround-django-tz-bug-861149/+merge/79634
  proposed by: Michael Hudson-Doyle (mwhudson)
  review: Approve - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 85 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2011-10-18 12:55:24 +1300
message:
  work around django bug that meant start_time was usually wrong on job page
modified:
  lava_scheduler_daemon/dbjobsource.py


--
lp:lava-scheduler
https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk

You are subscribed to branch lp:lava-scheduler.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_scheduler_daemon/dbjobsource.py'
--- lava_scheduler_daemon/dbjobsource.py	2011-08-22 03:20:17 +0000
+++ lava_scheduler_daemon/dbjobsource.py	2011-10-17 23:35:27 +0000
@@ -56,7 +56,7 @@ 
     def getBoardList(self):
         return self.deferForDB(self.getBoardList_impl)
 
-    @transaction.commit_manually()
+    @transaction.commit_on_success()
     def getJobForBoard_impl(self, board_name):
         while True:
             device = Device.objects.get(hostname=board_name)
@@ -93,15 +93,8 @@ 
                     job.save()
                     json_data = json.loads(job.definition)
                     json_data['target'] = device.hostname
-                    transaction.commit()
                     return json_data
             else:
-                # We don't really need to rollback here, as no modifying
-                # operations have been made to the database.  But Django is
-                # stupi^Wconservative and assumes the queries that have been
-                # issued might have been modifications.
-                # See https://code.djangoproject.com/ticket/16491.
-                transaction.rollback()
                 return None
 
     def getJobForBoard(self, board_name):