<commit_before>﻿using System.Collections.Generic;
using System.ServiceProcess;
using System.Threading;
using FFmpegFarm.WindowsService.Properties;

namespace FFmpegFarm.WindowsService
{
    public partial class Service : ServiceBase
    {
        private IList<Thread> _threads;
        private CancellationTokenSource _cancellationTokenSource;
        public Service()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            _threads = new List<Thread>();
            _cancellationTokenSource = new CancellationTokenSource();
            for (var x = 0; x < Settings.Default.Threads; x++)
            {
                var thread = new Thread(() => new Worker.Node(Settings.Default.FFmpegPath, Settings.Default.ControllerApi).Run(_cancellationTokenSource.Token));
                _threads.Add(thread);
                thread.Start();
            }
        }

        protected override void OnStop()
        {
            _cancellationTokenSource.Cancel();
            foreach (var thread in _threads)
            {
                thread.Join();
            }
        }
    }
}
<commit_msg>ws dummy logger added. temp todo log to event log<commit_after>﻿using System;
using System.Collections.Generic;
using System.ServiceProcess;
using System.Threading;
using FFmpegFarm.WindowsService.Properties;
using FFmpegFarm.Worker;

namespace FFmpegFarm.WindowsService
{
    public partial class Service : ServiceBase
    {
        private IList<Thread> _threads;
        private CancellationTokenSource _cancellationTokenSource;
        private static ILogger _logger = new DummyLogger();
        public Service()
        {
            InitializeComponent();
        }

        private class DummyLogger : ILogger
        {
            public void Debug(string text) { }

            public void Warn(string text) { }

            public void Exception(Exception exception) { }
        }

        protected override void OnStart(string[] args)
        {
            _threads = new List<Thread>();
            _cancellationTokenSource = new CancellationTokenSource();
            for (var x = 0; x < Settings.Default.Threads; x++)
            {
                var thread = new Thread(() => new Worker.Node(Settings.Default.FFmpegPath, Settings.Default.ControllerApi, _logger).Run(_cancellationTokenSource.Token));
                _threads.Add(thread);
                thread.Start();
            }
        }

        protected override void OnStop()
        {
            _cancellationTokenSource.Cancel();
            foreach (var thread in _threads)
            {
                thread.Join();
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.08515364679748241, 'fraction_numerical': 0.0007404664938911515, 'mean_word_length': 2.002222222222222, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6192100', 'n_tokens_mistral': 666, 'n_tokens_neox': 673, 'n_words': 160}