Commit fc4a9769 authored by Erick Hitter's avatar Erick Hitter
Browse files

Handle freeing event lock when there could be multiple concurrent executions

parent 029930dc
......@@ -353,7 +353,14 @@ class Events extends Singleton {
* @return bool
*/
private function reset_event_lock( $event ) {
return Lock::reset_lock( $this->get_lock_key_for_event_action( $event ), JOB_LOCK_EXPIRY_IN_MINUTES * \MINUTE_IN_SECONDS );
$lock_key = $this->get_lock_key_for_event_action( $event );
$expires = JOB_LOCK_EXPIRY_IN_MINUTES * \MINUTE_IN_SECONDS;
if ( isset( $this->concurrent_action_whitelist[ $event->action ] ) ) {
return Lock::free_lock( $lock_key, $expires );
} else {
return Lock::reset_lock( $lock_key, $expires );
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment