Index: trunk/ippToPsps/jython/ipptopspsdb.py
===================================================================
--- trunk/ippToPsps/jython/ipptopspsdb.py	(revision 32781)
+++ trunk/ippToPsps/jython/ipptopspsdb.py	(revision 32802)
@@ -103,4 +103,10 @@
     '''
     Returns a list of processed batch IDs that are not loaded to the datastore
+    NB we have a date constraint here because, before this time, it is possible that
+    a test batch would be labelled as processed but not loaded to datastore, and we would NOT
+    want to load a test batch to PSPS
+
+    ALSO, check that these batches are more than 4 HOURs old, so that we don't attempt to 
+    publish something simulataneously with the client that it producing them
     '''
     def getProcessedButFailedDatastoreBatchIDs(self, epoch, dvoGpc1Label, batchType):
@@ -112,5 +118,7 @@
                AND dvo_db = '" + dvoGpc1Label + "' \
                AND processed = 1\
-               AND loaded_to_datastore = -1"
+               AND loaded_to_datastore != 1 \
+               AND timestamp > '2011-10-27' \
+               AND timestamp < now() -  INTERVAL 4 HOUR"
 
         ids = []
