<commit_before>var abp = abp || {};
(function () {

    // Check if SignalR is defined
    if (!signalR) {
        return;
    }

    // Create namespaces
    abp.signalr = abp.signalr || {};
    abp.signalr.hubs = abp.signalr.hubs || {};
    abp.signalr.reconnectTime = 5000;
    abp.signalr.maxTries = 8;

    // Configure the connection for abp.signalr.hubs.common
    function configureConnection(connection) {
        // Set the common hub
        abp.signalr.hubs.common = connection;

        let tries = 1;

        // Reconnect loop
        function start() {
            if (tries > abp.signalr.maxTries) {
                return;
            } else {
                connection.start()
                    .then(() => {
                        abp.signalr.reconnectTime = 5000;
                        tries = 1;
                    })
                    .catch(() => {
                        setTimeout(() => {
                            start();
                        }, abp.signalr.reconnectTime);
                        abp.signalr.reconnectTime *= 2;
                        tries += 1;
                    });
            }
        }

        // Reconnect if hub disconnects
        connection.onclose(function (e) {
            if (e) {
                abp.log.debug('Connection closed with error: ' + e);
            } else {
                abp.log.debug('Disconnected');
            }

            if (!abp.signalr.autoReconnect) {
                return;
            }

            start();
        });

        // Register to get notifications
        connection.on('getNotification', function (notification) {
            abp.event.trigger('abp.notifications.received', notification);
        });
    }

    // Connect to the server for abp.signalr.hubs.common<commit_msg>use to async function and fix parameters overriding<commit_after>var abp = abp || {};
(function () {

    // Check if SignalR is defined
    if (!signalR) {
        return;
    }

    // Create namespaces
    abp.signalr = abp.signalr || {};
    abp.signalr.hubs = abp.signalr.hubs || {};
    abp.signalr.reconnectTime = abp.signalr.reconnectTime || 5000;
    abp.signalr.maxTries = abp.signalr.maxTries || 8;

    // Configure the connection for abp.signalr.hubs.common
    function configureConnection(connection) {
        // Set the common hub
        abp.signalr.hubs.common = connection;

        let tries = 1;
        let reconnectTime = abp.signalr.reconnectTime;

        // Reconnect loop
        async function tryReconnect() {
            if (tries > abp.signalr.maxTries) {
                return;
            } else {
                try {
                    await connection.start();
                    reconnectTime = abp.signalr.reconnectTime;
                    tries = 1;
                    console.log('Reconnected to SignalR CHAT server!');
                } catch (err) {
                    setTimeout(() => tryReconnect(), reconnectTime);
                    tries += 1;
                    reconnectTime *= 2;
                }
            }
        }

        // Reconnect if hub disconnects
        connection.onclose(function (e) {
            if (e) {
                abp.log.debug('Connection closed with error: ' + e);
            } else {
                abp.log.debug('Disconnected');
            }

            if (!abp.signalr.autoReconnect) {
                return;
            }

            await tryReconnect();
        });

        // Register to get notifications
        connection.on('getNotification', function (notification) {
            abp.event.trigger('abp.notifications.received', notification);
        });
    }

    // Connect to the server for abp.signalr.hubs.common
{'fraction_non_alphanumeric': 0.10991957104557641, 'fraction_numerical': 0.005898123324396783, 'mean_word_length': 1.331875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6648703', 'n_tokens_mistral': 1060, 'n_tokens_neox': 985, 'n_words': 210}