IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 27, 2012, 4:33:05 PM (14 years ago)
Author:
rhenders
Message:

changes to keep track of, and purge, ingested-but-out-of-date regions

File:
1 edited

Legend:

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

    r33175 r33177  
    184184
    185185    '''
     186    Do we have an out-of-date version of this file?
     187    '''
     188    def haveOutOfDateVersionOfThisDvoTable(self, path):
     189
     190        fileStat = os.stat(path)
     191
     192        sql = "SELECT COUNT(*) FROM " + self.dvoDoneTable + " WHERE path = '" + path + "' AND modifiedDate != " + str(fileStat.st_mtime)
     193
     194        try:
     195            rs = self.executeQuery(sql)
     196            rs.first()
     197            if rs.getInt(1) > 0:
     198                self.logger.debugPair("Have out-to-date version of",  path)
     199                return True
     200            else:
     201                return False
     202        except:
     203            self.logger.exception("Unable to check whether this DVO table is out-of-date")
     204
     205    '''
    186206    Have we already imported this DVO table?
     207    Checks path and modified date to be sure
    187208    '''
    188209    def alreadyImportedThisDvoTable(self, path):
Note: See TracChangeset for help on using the changeset viewer.