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

find a bug when using scheduler() #32381

Closed
Lovecxgood opened this issue Apr 16, 2024 · 2 comments
Closed

find a bug when using scheduler() #32381

Lovecxgood opened this issue Apr 16, 2024 · 2 comments
Labels
0 - new Ticket is unclear on it's purpose or if it is valid or not

Comments

@Lovecxgood
Copy link

ctx.getSystem().scheduler().scheduleOnce(Duration.ofMillis(22460288495L), () -> {
System.err.println("*************");
}, ctx.getSystem()));

I using akka scheduler meet a problem
when the delay time is too big,all the actor will auto stop
as the same as scheduler().scheduleAtFixedRate(delayTime,()->{})

@johanandren
Copy link
Member

The scheduler will throw an IllegalArgumentException if you try to schedule a task more than Int.MaxValue (2147483647) nanos into the future. 22460288495 ms is 22460288495000000ns, so will trigger that error. It should however explain exactly this upper limit.

In general the Akka Scheduler is built for tasks that happen soon, not in hundreds of days, for such scheduling of running tasks you will need to reach for some other scheduling tool.

@johanandren johanandren added the 0 - new Ticket is unclear on it's purpose or if it is valid or not label Apr 17, 2024
@Lovecxgood
Copy link
Author

ok , thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new Ticket is unclear on it's purpose or if it is valid or not
Projects
None yet
Development

No branches or pull requests

2 participants