IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32194 for trunk/ippToPsps


Ignore:
Timestamp:
Aug 25, 2011, 1:09:32 PM (15 years ago)
Author:
rhenders
Message:

added static method to publish a batch to the datastore, this is so batches that processed ok, but failed to reachdatastore, can be reloaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/batch.py

    r32163 r32194  
    285285    Publishes this batch to the datastore
    286286    '''
    287     def publishToDatastore(self):
     287    def tarZipAndpublishToDatastore(self):
    288288     
    289289        # set up filenams and paths
     
    308308
    309309        # now publish to the datastore
    310         if self.datastore.publish(self.batchName, self.subDir, tarballFile, "tgz"):
    311             self.ippToPspsDb.updateLoadedToDatastore(self.batchID, 1)
     310        Batch.publishToDatastore(self.datastore, self.ippToPspsDb, self.batchID, self.batchName, self.subDir, tarballFile)
     311
     312    '''
     313    Static method to publish a batch to the datastore
     314    '''
     315    @staticmethod
     316    def publishToDatastore(datastore, ippToPspsDb, batchID, batchName, subDir, tarballFile):
     317        if datastore.publish(batchName, subDir, tarballFile, "tgz"):
     318            ippToPspsDb.updateLoadedToDatastore(batchID, 1)
     319        else:
     320            ippToPspsDb.updateLoadedToDatastore(batchID, -1)
     321           
    312322
    313323    '''
     
    443453        except:
    444454            self.logger.exception("Could not write to FITS")
     455            self.ippToPspsDb.updateProcessed(self.batchID, -1)
    445456            return False
    446457
     
    510521            if self.exportPspsTablesToFits():
    511522                self.writeBatchManifest()
    512                 if int(self.doc.find("options/publishToDatastore").text): self.publishToDatastore()
     523                if int(self.doc.find("options/publishToDatastore").text): self.tarZipAndpublishToDatastore()
    513524                if int(self.doc.find("options/reportNulls").text): self.reportNullsInAllPspsTables(False)
    514525
Note: See TracChangeset for help on using the changeset viewer.