def sync_slots(self) -> None:
        """Synchronise slots for all scheduled databases."""
        with self._condition:
            databases = list(self._scheduled.keys())
        for database in databases:
            with self._condition:
                slots = list(self._scheduled.get(database, {}).keys())
            if slots:
                try:
                    self.sync_slots_in_database(database, slots)
                except Exception as e:
                    logger.error('Failed to advance replication slots in database %s: %r', database, e)
Synchronise slots for all scheduled databases.
patroni/postgresql/slots.py