def delete_before(self, segment_info):
        """
        Delete all base backups and WAL before a given segment

        This is the most commonly-used deletion operator; to delete
        old backups and WAL.

        """

        # This will delete all base backup data before segment_info.
        self._delete_base_backups_before(segment_info)

        # This will delete all WAL segments before segment_info.
        self._delete_wals_before(segment_info)

        if self.deleter:
            self.deleter.close()
Delete all base backups and WAL before a given segment

        This is the most commonly-used deletion operator; to delete
        old backups and WAL.