It seems that static JSContext (Iterator.rruleContext) is causing problems when there are quite a few calculations in differnet threads. It happens, when in some rare cases two context?.evaluateScript("var rule = new RRule({ \(ruleJSONString) })") is being called one after another and only then two dates calculations
one after another. In such case the second new RRule({ \(ruleJSONString) }) overwrites first RRule's properties in static JSContext and first calculation uses wrong parameters.
One way to avoid this issue would be not using static JSContext, but recreate it for each calculation. So, thats my suggestion. Not ideal, but at least it solves this dates calculation problem for me. Maybe you can suggest a better solution.
It seems that static JSContext (Iterator.rruleContext) is causing problems when there are quite a few calculations in differnet threads. It happens, when in some rare cases two
context?.evaluateScript("var rule = new RRule({ \(ruleJSONString) })")
is being called one after another and only then two dates calculationsone after another. In such case the second
new RRule({ \(ruleJSONString) })
overwrites first RRule's properties in static JSContext and first calculation uses wrong parameters. One way to avoid this issue would be not using static JSContext, but recreate it for each calculation. So, thats my suggestion. Not ideal, but at least it solves this dates calculation problem for me. Maybe you can suggest a better solution.