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 The lock is stored in the database, so there will be no problem in the cluster environment. LockLocalServiceUtil and its methods
lock () ,
unlock () and
isLocked () . Something like this:
Try {if (LockLocalServiceUtil.isLocked ()) {return; } LockLocalServiceUtil.lock (); // your work} finally {LockLocalServiceUtil.unlock (); }
Comments
Post a Comment