Closed mwithheld closed 5 years ago
The CI failures are due to "Plugin "local_redislock" (2017120800) could not be installed. It requires a newer version of Moodle".
Hi @polothy - would you be able/willing to look at the idea suggested here?
@polothy I'm still hoping to get this lock expiry mechanism in.
Thanks for the contribution, but it is unlikely that we would merge this. We did have TTL at the start, but found that long running processes would have their locks expire, then we get duplicate runs going which is much worse than a stale lock for us. For example, I don't think any scheduled task calls extend_lock
to extend the life of their lock. (From memory) I believe even other core locks do not use expire, but I might not be remembering that correctly or it was added after I looked.
You are more than welcome to fork or to maintain the patch yourself. Just be careful, I believe pexpire
is for milliseconds whereas expire
is for seconds.
Untested code