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 · 3 comments
Open

RunOnceAtStart sometimes it doesn't work. #353

Kerwin1202 opened this issue Nov 27, 2023 · 3 comments

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

@chris-rp
Copy link

This is still an issue in
.net8, coravel 5.0.4

Anything new on this issue?

@jamesmh
Copy link
Owner

jamesmh commented Sep 26, 2024

No news on this yet. Will look to investigate soon. Not sure what's going on at first glance. Unless someone else has any idea by looking at the source?

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

4 participants