Commit d798c289 authored by catch's avatar catch

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
......@@ -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
// generation is in progress in another thread.
$lock_name = 'image_style_deliver:' . $image_style->id() . ':' . Crypt::hashBase64($image_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);
if (!$lock_acquired) {
// Tell client to retry again in 3 seconds. Currently no browsers are
......
Markdown is supported
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