def METHOD_NAME(self, limit: int):
    """Called when cache limit changes"""
    self.__cache_limit_org = limit
    if limit < 0:
        self.__cache_limit = self.__cache_upper_limit
    else:
        self.__cache_limit = min(limit, self.__cache_upper_limit)
    # Set assembler_write_trigger to be the equivalent of ASSEMBLER_WRITE_THRESHOLD %
    # of the total cache, assuming an article size of 750 000 bytes
    self.assembler_write_trigger = int(self.__cache_limit * ASSEMBLER_WRITE_THRESHOLD / 100 / 750_000) + 1
    logging.debug(
        "Assembler trigger = %d",
        self.assembler_write_trigger,
    )