Index: trunk/ippTools/share/chiptool_pendingimfile.sql
===================================================================
--- trunk/ippTools/share/chiptool_pendingimfile.sql	(revision 27738)
+++ trunk/ippTools/share/chiptool_pendingimfile.sql	(revision 27856)
@@ -10,5 +10,6 @@
     rawExp.camera,
     rawExp.telescope,
-    rawExp.filelevel
+    rawExp.filelevel,
+    IFNULL(Label.priority, 10000) AS priority
 FROM chipRun
 JOIN rawExp
@@ -25,4 +26,5 @@
 LEFT JOIN chipMask
     ON chipRun.label = chipMask.label
+LEFT JOIN Label ON chipRun.label = Label.label
 WHERE
     ((chipRun.state = 'new'
@@ -35,2 +37,3 @@
     AND chipProcessedImfile.data_state = 'update'
     AND chipProcessedImfile.fault = 0))
+    AND (Label.active OR Label.active IS NULL)
