Developer forum

Forum » Integration » Integration RunJob - LastRun date/time set before next run

Integration RunJob - LastRun date/time set before next run

Jon Thorne
Jon Thorne
Reply

As of v9.15.5 the code has been updated to set the result of "job.LastSuccessfulRun" to the current date/time instead of the last run date/time.

In commit "ea3a9f345ce7a3851bf1368084cf7c71e11de48e" this line was added:

Line 508: SetLastRun();

This is now set before the current integration task is run. I believe this should be set after so that the task can utilise this information when running the task.

Please let me know if this can be fixed or there is a work-around for this.


Replies

 
Jon Thorne
Jon Thorne
Reply

Actually after some more testing the LastRun in v9.15.4 does not work either, but this time it is not updated at all. So just stays at an older date/time.

I just ended up writing my own function to make sure this works for my custom integration task on any version. But this will probably also be an issue for any "Delta" replication task using standard integration modules.

 
Matthias Sebastian Sort Dynamicweb Employee
Matthias Sebastian Sort
Reply

Hi Jon,

Yes we set the SetLastRun() before running the job, as we don't know how long the job takes to run, and we do this because when doing "Delta" and set the time after the job will conflict with what data you'll recieve from e.g. your endpoint, so all the data that has been updated on the external system, while the job is running, will not come in the next "Delta" run.

The "Old" logic, before we implemented this, it was looping all your log-files to check for a specific string-line containing "Batch succeeded." and that is wrong, as this is the last line of the log-file, meaning it is after the job is finished, so this could not be used for "Delta" jobs.

I think there is a bug in the version 9.15.4 for the new logic.

BR

Matthias Sort

 
Jon Thorne
Jon Thorne
Reply

Hi Matthias,

Ok. I can see now how the "Delta" works as you call the check for LastSuccessfulRun when you create the source object, before you call the initialise or run the job. If I want to use this the last successful run in the RunJob function I will have to make my own implementation of this.

Regards,

Jon.

 

You must be logged in to post in the forum