liferay - Dont run job when it is allready running -


I have a job set in liefair, for example, if this job is going on every 5 minutes and fulfilling it It requires more than 5 minutes

What I have seen is that the job will start right now, this can cause problems for me.

Is it not possible in any way a job, when it is going on completely?

* Use of cramps 6.0.6

thanks

Try LockLocalServiceUtil and its methods lock () , unlock () and isLocked () . Something like this:

  Try {if (LockLocalServiceUtil.isLocked ()) {return; } LockLocalServiceUtil.lock (); // your work} finally {LockLocalServiceUtil.unlock (); }   

The lock is stored in the database, so there will be no problem in the cluster environment.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -