Skip to content
Snippets Groups Projects
Commit d798c289 authored by catch's avatar catch
Browse files

Issue #2786855 by claudiu.cristea: Don't compute the lock name if not...

Issue #2786855 by claudiu.cristea: Don't compute the lock name if not necessary when generating image derivatives
parent a9f61307
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -139,8 +139,8 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st ...@@ -139,8 +139,8 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st
// Don't start generating the image if the derivative already exists or if // Don't start generating the image if the derivative already exists or if
// generation is in progress in another thread. // generation is in progress in another thread.
$lock_name = 'image_style_deliver:' . $image_style->id() . ':' . Crypt::hashBase64($image_uri);
if (!file_exists($derivative_uri)) { if (!file_exists($derivative_uri)) {
$lock_name = 'image_style_deliver:' . $image_style->id() . ':' . Crypt::hashBase64($image_uri);
$lock_acquired = $this->lock->acquire($lock_name); $lock_acquired = $this->lock->acquire($lock_name);
if (!$lock_acquired) { if (!$lock_acquired) {
// Tell client to retry again in 3 seconds. Currently no browsers are // Tell client to retry again in 3 seconds. Currently no browsers are
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment