<commit_before>﻿using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SFA.DAS.EAS.Portal.Jobs.Startup;
using SFA.DAS.EAS.Portal.Jobs.StartupJobs;
using SFA.DAS.EAS.Portal.Startup;

namespace SFA.DAS.EAS.Portal.Jobs
{
    class Program
    {
        //useful links
        //https://stackoverflow.com/questions/51970969/how-to-use-hostbuilder-for-webjob
        //https://github.com/Azure/azure-webjobs-sdk/wiki/Application-Insights-Integration
        //https://github.com/Azure/azure-webjobs-sdk/blob/dev/sample/SampleHost/Program.cs
        //https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-how-to

        //todo: how to see & trigger individual jobs in v3?
        //https://github.com/Azure/azure-webjobs-sdk/issues/1975

        //todo: functions instead? https://github.com/tmasternak/NServiceBus.Functions
        //todo: not finding helloworld webjob
        static async Task Main(string[] args)
        {
            //await CreateHostBuilder(args).RunConsoleAsync();

            using (var host = CreateHostBuilder(args).Build())
            {
                await host.StartAsync();
                //https://github.com/Azure/azure-webjobs-sdk/issues/1940
                //await host.Services.GetService<IJobHost>().CallAsync(nameof(CreateReadStoreDatabaseJob));

                var jobHost = host.Services.GetService<IJobHost>();
                await jobHost.CallAsync(nameof(CreateReadStoreDatabaseJob.CreateReadStoreDatabase));

                //await host.Services.GetService<IJobHost>()
                //    .CallAsync(nameof(CreateReadStoreDatabaseJob.CreateReadStoreDatabase));

                //host.Run();
                //await host.RunAsync();
                await host.WaitForShutdownAsync();
            }
        }<commit_msg>tidy up<commit_after>﻿using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SFA.DAS.EAS.Portal.Jobs.Startup;
using SFA.DAS.EAS.Portal.Jobs.StartupJobs;
using SFA.DAS.EAS.Portal.Startup;

namespace SFA.DAS.EAS.Portal.Jobs
{
    class Program
    {
        //useful links
        //https://stackoverflow.com/questions/51970969/how-to-use-hostbuilder-for-webjob
        //https://github.com/Azure/azure-webjobs-sdk/wiki/Application-Insights-Integration
        //https://github.com/Azure/azure-webjobs-sdk/blob/dev/sample/SampleHost/Program.cs
        //https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-how-to

        //todo: how to see & trigger individual jobs in v3?
        //https://github.com/Azure/azure-webjobs-sdk/issues/1975

        //todo: functions instead? https://github.com/tmasternak/NServiceBus.Functions
        static async Task Main(string[] args)
        {
            //await CreateHostBuilder(args).RunConsoleAsync();

            using (var host = CreateHostBuilder(args).Build())
            {
                await host.StartAsync();
                //https://github.com/Azure/azure-webjobs-sdk/issues/1940

                var jobHost = host.Services.GetService<IJobHost>();
                await jobHost.CallAsync(nameof(CreateReadStoreDatabaseJob.CreateReadStoreDatabase));

                await host.WaitForShutdownAsync();
            }
        }
{'fraction_non_alphanumeric': 0.1254831995242343, 'fraction_numerical': 0.010110020814748736, 'mean_word_length': 2.45025641025641, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 14, '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': '4109558', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1000, 'n_words': 132}