from clarabot_nano.core.config.update.base import AbstractRemoteConfigUpdateHandler


class UpdateServerProcessNumber(AbstractRemoteConfigUpdateHandler):
    HANDLER_KEY = "server_process_number"

    def _execute(self, data: dict):
        self._c["server_process_number"] = data["server_process_number"]

    def _describe_change(self, old_config: dict, new_config: dict, data: dict) -> str:
        return f"Number of server processes set to {new_config.get('server_process_number')!r}"
