def update_checkpoint_of_disabling_function(self, make_count_zero=False):
        """Update checkpoint file for disabling function.

        Args:
            make_count_zero (bool): True when count of status code should be made zero

        Raises:
            Exception: if anything goes unintended
        """
        try:
            __method_name = inspect.currentframe().f_code.co_name
            checkpoint_file = self.state.get()
            checkpoint_json_data = {"disable_function": False}
            if checkpoint_file:
                checkpoint_json_data.update(json.loads(checkpoint_file))
            if checkpoint_json_data.get("disable_function"):
                checkpoint_json_data.update({"disable_function": False, "status_code_count": 0})
                self.state.post(json.dumps(checkpoint_json_data))
            if make_count_zero:
                if checkpoint_json_data.get("status_code_count") != 0:
                    checkpoint_json_data.update({"status_code_count": 0})
                    self.state.post(json.dumps(checkpoint_json_data))
                    self.applogger.debug(
                        "{}(method={}): {}: Checkpoint file updated as total count of status code made zero.".format(
                            consts.LOGS_STARTS_WITH, __method_name, self.function_name
                        )
                    )
                else:
                    self.applogger.debug(
                        "{}(method={}): {}: Checkpoint file already have total count of status code equal to zero.".format(
                            consts.LOGS_STARTS_WITH, __method_name, self.function_name
                        )
                    )
            else:
                current_count = checkpoint_json_data.get("status_code_count", 0)
                updated_status_code_count = current_count + 1
                if updated_status_code_count >= 10:
                    self.applogger.info(
                        "{}(method={}): {}: Function App will be Disabled.".format(
                            consts.LOGS_STARTS_WITH, __method_name, self.function_name
                        )
                    )
                    checkpoint_json_data.update({"disable_function": True, "status_code_count": updated_status_code_count})
                    self.state.post(json.dumps(checkpoint_json_data))
                    self.disable_function()
                    return

                checkpoint_json_data.update({"status_code_count": updated_status_code_count})
                self.state.post(json.dumps(checkpoint_json_data))
                self.applogger.debug(
                    "{}(method={}): {}: Updated failed status code count in checkpoint file.".format(
                        consts.LOGS_STARTS_WITH, __method_name, self.function_name
                    )
                )

        except Exception as err:
            self.applogger.error(
                "{}(method={}): {}: Error Occured while updating checkpoint file of disabling function. : '{}'".format(
                    consts.LOGS_STARTS_WITH, __method_name, self.function_name, err
                )
            )

            raise Exception(f"Error Occured while updating checkpoint file of disabling function: {err}")
Update checkpoint file for disabling function.

        Args:
            make_count_zero (bool): True when count of status code should be made zero

        Raises:
            Exception: if anything goes unintended
        
Solutions/Vectra XDR/Data Connectors/VectraDataConnector/SharedCode/collector.py