Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunOnceAtStart sometimes it doesn't work. #353

Open
Kerwin1202 opened this issue Nov 27, 2023 · 1 comment
Open

RunOnceAtStart sometimes it doesn't work. #353

Kerwin1202 opened this issue Nov 27, 2023 · 1 comment

Comments

@Kerwin1202
Copy link

Kerwin1202 commented Nov 27, 2023

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

@arteny
Copy link

arteny commented Feb 7, 2024

Not works for me in .net 8 with ScheduleAsync as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants