[freeside-commits] freeside/FS/bin freeside-queued,1.39,1.40
Ivan,,,
ivan at wavetail.420.am
Fri Apr 17 12:50:13 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv29115/FS/bin
Modified Files:
freeside-queued
Log Message:
add priority to job queue so billing jobs don't don't drown out provisioning jobs
Index: freeside-queued
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-queued,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- freeside-queued 25 Jan 2009 20:43:14 -0000 1.39
+++ freeside-queued 17 Apr 2009 19:50:11 -0000 1.40
@@ -84,9 +84,12 @@
my $nodepend = 'AND 0 = ( SELECT COUNT(*) FROM queue_depend'.
' WHERE queue_depend.jobnum = queue.jobnum )';
- my $order_by = "ORDER BY jobnum ". ( driver_name eq 'mysql'
- ? 'LIMIT 1 FOR UPDATE'
- : 'FOR UPDATE LIMIT 1' );
+ #anything with a priority goes after stuff without one
+ my $order_by = ' ORDER BY COALESCE(priority,0) ASC, jobnum ASC ';
+
+ $order_by .= ( driver_name eq 'mysql'
+ ? ' LIMIT 1 FOR UPDATE '
+ : ' FOR UPDATE LIMIT 1 ' );
my $job = qsearchs({
'table' => 'queue',
More information about the freeside-commits
mailing list