<commit_before>﻿using System;
using Common.Logging;
using Microsoft.Owin.Hosting;
using System.Threading;

namespace NuGet.Lucene.Web.OwinHost.Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            var log = LogManager.GetCurrentClassLogger();
            const string baseAddress = "http://*:9001/";

            var cancelToken = new CancellationTokenSource();

            Console.TreatControlCAsInput = false;
            Console.CancelKeyPress += (_, __) => cancelToken.Cancel();

            try
            {
                using (WebApp.Start<Startup>(baseAddress))
                {
                    Console.WriteLine("Listening on " + baseAddress + ". Press <ctrl>+c to stop listening.");
                    cancelToken.Token.WaitHandle.WaitOne();
                }
            }
            catch (Exception ex)
            {
                log.Fatal(m => m(ex.Message), ex);
            }

            Console.WriteLine("Press enter to quit.");
            Console.ReadLine();
        }
    }
}<commit_msg>Don't use ctrl-c handler, it's too buggy.<commit_after>﻿using System;
using Common.Logging;
using Microsoft.Owin.Hosting;
using System.Threading;

namespace NuGet.Lucene.Web.OwinHost.Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            var log = LogManager.GetCurrentClassLogger();
            const string baseAddress = "http://*:9001/";

            try
            {
                using (WebApp.Start<Startup>(baseAddress))
                {
                    Console.WriteLine("Listening on " + baseAddress + ". Press <ctrl>+c to stop listening.");
                    Console.WriteLine("Press enter to stop.");
                    Console.ReadLine();
                }
            }
            catch (Exception ex)
            {
                log.Fatal(m => m(ex.Message), ex);
                Console.WriteLine("Press enter to quit.");
                Console.ReadLine();
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.11127596439169139, 'fraction_numerical': 0.003956478733926805, 'mean_word_length': 1.5382685069008784, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '4620936', 'n_tokens_mistral': 536, 'n_tokens_neox': 509, 'n_words': 110}