'Check if a vacuum operation has been performed recently.'

def _HasRecentVacuum(self):

    query = "SELECT    value    FROM    statistics    WHERE    name    =    'vacuum_time'"
    data = self.Execute(query).fetchone()
    if (not data):
        return False
    try:
        last_vacuum = int(str(data[0]))
        vacuum_frequency = config.CONFIG['SqliteDatastore.vacuum_frequency']
        return ((time.time() - last_vacuum) < vacuum_frequency)
    except ValueError:
        return False
