Exemple #1
0
    def __writeback(self):
        """Really commit pending log records into the database"""

        connection = DATABASE.connection()
        table_log.prune(connection, DAYS_AGO, commit=False)

        for record in self._queue:
            table_log.insert(connection, record, False)
        connection.commit()

        connection.execute("VACUUM;")
        connection.commit()
Exemple #2
0
    def _writeback(self):
        """Really commit pending log records into the database"""

        connection = DATABASE.connection()
        table_log.prune(connection, DAYS_AGO, commit=False)

        for record in self._queue:
            table_log.insert(connection, record, False)
        connection.commit()

        now = utils.ticks()
        if now - self.last_vacuum > INTERVAL_VACUUM:
            connection.execute("VACUUM;")
            self.last_vacuum = now
        connection.commit()