<commit_before>task = (function(uuid){
    self = this;

    var task_api = "/api/v4/task?uuid=" + uuid;
    var taskresult_api = "/api/v4/taskresult/" + uuid;

    // Initial timeout in milliseconds. Will increase half a second for
    // every poll, with an upper limit of 3 seconds.
    var timeout = 200;

    /*
     * Po
     */
    function poll(timeout){
        $.ajax({
            url: task_api,
            dataType: 'json',
            success: poll_success,
            error: poll_error
        })
    }

    function poll_error(){
        $("#status").text("Polling failed. Refresh?");
    }

    function poll_success(data){
        self.timeout = (timeout >= 3000) ? timeout : timeout + 500;

        var task = data["results"][0];
        if (!task.ready && task.status === "INPROGRESS" && task.progress !== null){
            // Not yet ready, progress indication supplied
            window.setTimeout(poll, timeout);
        } else if (!task.ready){
            // Not yet ready, but no progress indiction supplied also
            window.setTimeout(poll, timeout);
        } else if (task.ready && task.status != "SUCCESS") {
            // Task ready, but failed.
            task_failed(task);
        } else {
            // Task ready and available for download
            task_success(task);
        }

        update_progress(task);
    }

    function update_progress(task){
        $("#status").text(task.status);

        if (task.progress !== null){
            $("#message").text(task.message);
            $("#progress").text(task.progress);
        }
    }

    function task_failed(task){
        console.log("failed")
    }

    function task_success(task){
        $(".hide-if-success").hide();
        $("#results").show();
    }

    poll();
});<commit_msg>Fixed scoping issue causing poll delay to stay at 200 ms.<commit_after>task = (function(uuid){
    self = this;

    var task_api = "/api/v4/task?uuid=" + uuid;
    var taskresult_api = "/api/v4/taskresult/" + uuid;

    // Initial timeout in milliseconds. Will increase half a second for
    // every poll, with an upper limit of 3 seconds.
    var timeout = 200;

    /*
     * Po
     */
    function poll(timeout){
        $.ajax({
            url: task_api,
            dataType: 'json',
            success: poll_success,
            error: poll_error
        })
    }

    function poll_error(){
        $("#status").text("Polling failed. Refresh?");
    }

    function poll_success(data){
        timeout = (timeout >= 3000) ? timeout : timeout + 500;

        var task = data["results"][0];
        if (!task.ready && task.status === "INPROGRESS" && task.progress !== null){
            // Not yet ready, progress indication supplied
            window.setTimeout(poll, timeout);
        } else if (!task.ready){
            // Not yet ready, but no progress indiction supplied also
            window.setTimeout(poll, timeout);
        } else if (task.ready && task.status != "SUCCESS") {
            // Task ready, but failed.
            task_failed(task);
        } else {
            // Task ready and available for download
            task_success(task);
        }

        update_progress(task);
    }

    function update_progress(task){
        $("#status").text(task.status);

        if (task.progress !== null){
            $("#message").text(task.message);
            $("#progress").text(task.progress);
        }
    }

    function task_failed(task){
        console.log("failed")
    }

    function task_success(task){
        $(".hide-if-success").hide();
        $("#results").show();
    }

    poll();
});
{'fraction_non_alphanumeric': 0.14242507561176795, 'fraction_numerical': 0.008523508386032445, 'mean_word_length': 1.894192521877486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3800142', 'n_tokens_mistral': 1035, 'n_tokens_neox': 995, 'n_words': 260}