async def vacuum_database(self, full: bool = False, analyze: bool = True):
        """Run vacuum on the entire database"""
        start_time = datetime.now()

        try:
            await (
                self.providers.database.maintenance_handler.vacuum_all_tables(
                    analyze=analyze, full=full
                )
            )

            duration = datetime.now() - start_time
            logger.info(
                f"Database vacuum completed successfully in {duration.total_seconds():.2f} seconds"
            )
        except Exception as e:
            logger.error(f"Database vacuum failed: {str(e)}")
Run vacuum on the entire database
py/core/main/services/maintenance_service.py