Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9
-
Fix Version/s: 1.9
-
Component/s: Administration
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
rewrite cron locking to use expiration time in value instead of guessing when we can dispose it later
simplify/rewrite the locking code
set_time_limit() MUST be used together with locks
The rewritten locking allows code to lock something for specific time, it is highly recommended to use it in combination with set_time_limit(). The scrip execution limit should be lowered a bit to guarantee that the code is not executing anymore when the lock is considered to be already released. Code may extend the lock duration now.
Benefits:
1/ much easier to use
2/ set_time_limit() improves the locking logic