def schedule(self, advance_slots: Dict[str, Dict[str, int]]) -> Tuple[bool, List[str]]:
        """Trigger a synchronisation of slots.

        This is the main entrypoint for Patroni HA loop wakeup call.

        :param advance_slots: dictionary containing slots that need to be advanced

        :return: tuple of failure status and a list of slots to be copied
        """
        with self._condition:
            for database, values in advance_slots.items():
                for name, value in values.items():
                    # Don't schedule sync for slots that just failed to be advanced and scheduled to be copied
                    if name not in self._copy_slots:
                        self._scheduled[database][name] = value
            ret = (self._failed, self._copy_slots)
            self._copy_slots = []
            self._failed = False
            self._condition.notify()

        return ret
Trigger a synchronisation of slots.

        This is the main entrypoint for Patroni HA loop wakeup call.

        :param advance_slots: dictionary containing slots that need to be advanced

        :return: tuple of failure status and a list of slots to be copied
        
patroni/postgresql/slots.py