def finished(experiment_name, reset=True):
    if _exclude_visitor():
        return
    redis = _get_redis_connection()
    try:
        experiment = Experiment.find(redis, experiment_name)
        if not experiment:
            return
        alternative_name = _get_session().get(experiment.key)
        if alternative_name:
            split_finished = set(session.get('split_finished', []))
            if experiment.key not in split_finished:
                alternative = Alternative(
                    redis, alternative_name, experiment_name)
                alternative.increment_completion()
            if reset:
                _get_session().pop(experiment.key, None)
                try:
                    split_finished.remove(experiment.key)
                except KeyError:
                    pass
            else:
                split_finished.add(experiment.key)
            session['split_finished'] = list(split_finished)
    except ConnectionError:
        if not current_app.config['SPLIT_DB_FAILOVER']:
            raise
Track a conversion.
dataset/ETHPy150Open jpvanhal/flask-split/flask_split/core.py/finished