jamesmh / coravel

Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!
https://docs.coravel.net/Installation/
MIT License
3.92k stars 257 forks source link

ScheduleInvocableType Cron method not working with .NET 6 #306

Closed linfeng627 closed 2 years ago

linfeng627 commented 2 years ago

Describe the bug windows dotnet6

Affected Coravel Feature Scheduling, Queuing, etc.?

public static WebApplication UseCoravelJob(this WebApplication app)
{
            var types = Assembly.GetExecutingAssembly().GetTypes().Where(p => p.GetCustomAttribute<CoravelJobAttribute>() != null);

            app.Services.UseScheduler(scheduler =>
            {
                foreach (var item in types)
                {
                    var coravelJob = item.GetCustomAttribute<CoravelJobAttribute>();
                    scheduler.ScheduleInvocableType(item).Cron(coravelJob.Cron); // coravelJob.Cron Value Is  * * * * *
                }
            });

            return app;
 }

Expected behaviour A clear and concise description of what you expected to happen.

jamesmh commented 2 years ago

I'll need more details to help. What happens? Does the error occur at run time, compile time? Is there a specific exception that's thrown? Does everything seem to work but the job doesn't run? etc.

Thanks!