Servoy / svyUtils

Wide range of low-level utility methods and application concepts for Servoy solutions
5 stars 5 forks source link

Incorrect dates in batch processor using TODAY_START and TODAY_END #6

Closed og1 closed 8 years ago

og1 commented 8 years ago

svyDateUtils initializes the constants TODAY_START and TODAY_END by using an anonymous function for initTodayVars. This causes errors/bugs in any process that runs over midnight. The next day and all days after that the constants will have the same date until the process is restarted.

pruhsert commented 8 years ago

These variables are only meant to be used in relations. To be used as such, we can't make them methods. The only option to fix this would be to schedule a job that will reset them.

og1 commented 8 years ago

Hmm. In a relation the same bug will occur and be rather difficult to trace back to this particular issue. It would be nice if these constants were added to Servoy Java code with a proper getter. Anyway, thanks for your reply Patrick.

pruhsert commented 8 years ago

I think we should add a scheduler that resets these. What's wrong with that? It will simply run once a day.

og1 commented 8 years ago

If that's easy to do then it could avoid some nasty trouble ;-). However, it seems like it would be hard to get it to switch at exactly midnight or else it could still fail, especially if other jobs are running at the same time.

pruhsert commented 8 years ago

I think it will work in such a way that it tries to get it right at midnight. Possibly, it's done later. But maybe better than never.

Getters for scope variables would be nice indeed.

pruhsert commented 8 years ago

I added a schedule now to reset these

og1 commented 8 years ago

Great. Thanks, Patrick!

Kind regards,

Omar van Galen

06-2 12345 86 omar@intrasoft.nl mailto:omar@intrasoft.nl

On 8 jul. 2016, at 09:19, Patrick Ruhsert notifications@github.com wrote:

I added a schedule now to reset these

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Servoy/svyUtils/issues/6#issuecomment-231292434, or mute the thread https://github.com/notifications/unsubscribe/AITWZelN-R-IneABmPtkuMcTOMQgYma7ks5qTfoHgaJpZM4I-7q2.