wpdb; if(!$customer)return $operation(); $key=\ABeCe\Booking\Infrastructure\Database\Tables::lock($wpdb,'customer',(string)$customer); if((string)$wpdb->get_var($wpdb->prepare('SELECT GET_LOCK(%s, 15)',$key))!=='1')throw new CatalogException('abece_booking_customer_booking_busy',__('Another booking for this customer is being processed. Please try again.','abece-booking'),503); try{return $operation();}finally{$wpdb->get_var($wpdb->prepare('SELECT RELEASE_LOCK(%s)',$key));} } }