changeset 630:24237be52cfd

added priority-based dequeuing to sql.book_dct_postgres
author James Bergstra <bergstrj@iro.umontreal.ca>
date Tue, 20 Jan 2009 23:30:17 -0500
parents 4e7781972999
children e52a5c3aaca5
files pylearn/dbdict/sql.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/dbdict/sql.py	Mon Jan 19 18:35:43 2009 -0500
+++ b/pylearn/dbdict/sql.py	Tue Jan 20 23:30:17 2009 -0500
@@ -86,6 +86,9 @@
         # use dedicated column to retrieve jobs, not the dictionary keyval pair
         # This should be much faster.
         q = q.filter(db._Dict.status==START)
+        q = q.order_by(db._Dict.priority.desc())
+
+        # this doesn't seem to work, hene the string hack below
         q = q.options(eagerload('_attrs')) #hard-coded in api0
 
         #try to reserve a dct