def __call__(self, chunk_size):
     self.logger.info(
         "%s (limited to %d rows)", self.statement.splitlines()[0],
         chunk_size)
     store = IMasterStore(DistroSeries)
     result = store.execute(self.statement, (self.series.id, chunk_size,))
     self.done = (result.rowcount == 0)
     self.logger.info(
         "%d rows deleted (%s)", result.rowcount,
         ("done" if self.done else "not done"))
     store.commit()
Пример #2
0
 def __call__(self, chunk_size):
     self.logger.info(
         "%s (limited to %d rows)", self.statement.splitlines()[0],
         chunk_size)
     store = IMasterStore(DistroSeries)
     result = store.execute(self.statement, (self.series.id, chunk_size,))
     self.done = (result.rowcount == 0)
     self.logger.info(
         "%d rows deleted (%s)", result.rowcount,
         ("done" if self.done else "not done"))
     store.commit()
Пример #3
0
    def main(self):
        "Run UpdateDatabaseTableStats." ""
        store = IMasterStore(Person)

        # The logic is in a stored procedure because we want to run
        # ps(1) on the database server rather than the host this script
        # is running on.
        self.logger.debug("Invoking update_database_stats()")
        store.execute("SELECT update_database_stats()", noresult=True)

        self.logger.debug("Committing")
        store.commit()
    def main(self):
        "Run UpdateDatabaseTableStats."""
        store = IMasterStore(Person)

        # The logic is in a stored procedure because we want to run
        # ps(1) on the database server rather than the host this script
        # is running on.
        self.logger.debug("Invoking update_database_stats()")
        store.execute("SELECT update_database_stats()", noresult=True)

        self.logger.debug("Committing")
        store.commit()