Created
May 27, 2013 14:17
-
-
Save arialdomartini/5657310 to your computer and use it in GitHub Desktop.
synchronized on background job? Ha senso?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClassMethod HousekeepingUnscheduledAdverts() | |
{ | |
lock +^DateOfLastLifecycleUnscheduledAdsHK | |
set $ZTRAP = "Error" | |
if (..IsReschedulingEnabledNow()) { | |
set ^DateOfLastLifecycleUnscheduledAdsHK = ##class(Util.DateTime).Today() | |
do ##class(Util.Job).RunCommand("do ##class(JE.AdvertLifecycle.Scheduling.Data.AdvertSchedule.RescheduleUnscheduledAds()") | |
} | |
Error | |
set $ZTRAP = "" | |
lock -^DateOfLastLifecycleUnscheduledAdsHK | |
} | |
private synchronized static void housekeepingUnscheduledAdverts() { | |
if(isReschedulingEnabledNow()) { | |
Global.set(Util.DateTime.Today(), "^DateOfLastLifecycleUnscheduledAdsHK"); | |
Job.RunCommand("JE.AdvertLifecycle.Scheduling.Data.AdvertSchedule.rescheduleUnscheduledAds()"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment