coravel
coravel copied to clipboard
RunOnceAtStart sometimes it doesn't work.
Describe the bug
scheduler.Schedule<Service>()
.Cron("30 */2 * * *")
.RunOnceAtStart()
.Zoned(TimeZoneInfo.Local);
scheduler.ScheduleAsync(async () =>
{
Console.WriteLine("Start refresh data");
// ... other code
})
.DailyAtHour(9)
.RunOnceAtStart()
.Zoned(TimeZoneInfo.Local);
public class Service : IInvocable
{
...... other code
public async Task Invoke()
{
_logger. Information($"Start login {_config. UserName}");
await Login();
}
...... other code
}
Affected Coravel Feature Scheduling
Expected behaviour Output content immediately when starting the program. ( "Start login xxx" and "Start refresh data") , but when I run it many times, sometimes it does not output content, and the console does not report any error message.
run windows service. .net core 7.0 coravel : 5.0.2.0
Not works for me in .net 8 with ScheduleAsync as well