<commit_before>﻿using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR;

namespace TeamCityNotifier.NotificationServer
{
    public class BuildsConnection : PersistentConnection
    {
        protected override async Task OnReceived(IRequest request, string connectionId, string buildTypeIds)
        {
            var ids = buildTypeIds.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries)
                .Select(id => id.Trim());
            
            foreach (var id in ids)
                await this.AddToGroups(connectionId, id);

            await base.OnReceived(request, connectionId, buildTypeIds);
        }

        protected virtual Task AddToGroups(string connectionId, string buildTypeId)
        {
            return this.Groups.Add(connectionId, buildTypeId);
        }<commit_msg>Log to console when a connection registers for listening to a build<commit_after>﻿using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR;

namespace TeamCityNotifier.NotificationServer
{
    public class BuildsConnection : PersistentConnection
    {
        protected override async Task OnReceived(IRequest request, string connectionId, string buildTypeIds)
        {
            var ids = buildTypeIds.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries)
                .Select(id => id.Trim());
            
            foreach (var id in ids)
                await this.AddToGroups(connectionId, id);

            await base.OnReceived(request, connectionId, buildTypeIds);
        }

        protected virtual Task AddToGroups(string connectionId, string buildTypeId)
        {
            Console.WriteLine("Connection {0} registered to build {1}", connectionId.Substring(0, 8), buildTypeId);
            return this.Groups.Add(connectionId, buildTypeId);
        }
{'fraction_non_alphanumeric': 0.08270676691729323, 'fraction_numerical': 0.0021482277121374865, 'mean_word_length': 2.8098159509202456, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '793619', 'n_tokens_mistral': 465, 'n_tokens_neox': 462, 'n_words': 124}