The state planner background service uses Task.Delay() to wait for the next planned state (see the call at line 113).
According to the .NET docs, this method throws an exception when the delay argument's TotalMilliseconds property is greater than 4294967294 on .NET 6 and later versions, or Int32.MaxValue on all previous versions.
I believe the app currently runs on .NET 5 in production. That means the maximum time that can pass between two states is 2147483647/1000/60/60/24 = 24.85 days. In other cases, the call throws and kills the app.
A check must be added for this constraint. If the target wait time is longer, it should be enough to just wait for the maximum possible time and then continue the while cycle so that the next state is repolled.
The state planner background service uses
Task.Delay()
to wait for the next planned state (see the call at line 113).According to the .NET docs, this method throws an exception when the delay argument's
TotalMilliseconds
property is greater than 4294967294 on .NET 6 and later versions, orInt32.MaxValue
on all previous versions.I believe the app currently runs on .NET 5 in production. That means the maximum time that can pass between two states is 2147483647/1000/60/60/24 = 24.85 days. In other cases, the call throws and kills the app.
A check must be added for this constraint. If the target wait time is longer, it should be enough to just wait for the maximum possible time and then
continue
the while cycle so that the next state is repolled.