<commit_before>using Signum.Engine.Scheduler;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;

namespace Signum.React.Scheduler;

public static class SchedulerServer
{
    public static void Start(IApplicationBuilder app, IHostApplicationLifetime lifetime)
    {
        SignumControllerFactory.RegisterArea(MethodInfo.GetCurrentMethod());

        lifetime.ApplicationStopping.Register(() =>
        {
            if (SchedulerLogic.Running)
                SchedulerLogic.StopScheduledTasks();

            SchedulerLogic.StopRunningTasks();
        });
    }
}<commit_msg>fix ScheduleTaskRunner<commit_after>using Signum.Engine.Scheduler;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;

namespace Signum.React.Scheduler;

public static class SchedulerServer
{
    public static void Start(IApplicationBuilder app, IHostApplicationLifetime lifetime)
    {
        SignumControllerFactory.RegisterArea(MethodInfo.GetCurrentMethod());

        lifetime.ApplicationStopping.Register(() =>
        {
            if (ScheduleTaskRunner.Running)
                ScheduleTaskRunner.StopScheduledTasks();

            ScheduleTaskRunner.StopRunningTasks();
        });
    }
}
{'fraction_non_alphanumeric': 0.08367514356029532, 'fraction_numerical': 0.0, 'mean_word_length': 3.5185185185185186, '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': '4148170', 'n_tokens_mistral': 307, 'n_tokens_neox': 307, 'n_words': 51}