Prevent race condition on thumbnail generation

This commit is contained in:
Kijin Sung 2015-08-17 10:49:12 +09:00
parent 94d43c2b76
commit 4e6d768dab
2 changed files with 6 additions and 8 deletions

View file

@ -584,6 +584,9 @@ class commentItem extends Object
}
}
// Prevent race condition
FileHandler::writeFile($thumbnail_file, '', 'w');
// Target file
$source_file = NULL;
$is_tmp_file = FALSE;
@ -685,12 +688,6 @@ class commentItem extends Object
return $thumbnail_url;
}
// create an empty file not to attempt to generate the thumbnail afterwards
else
{
FileHandler::writeFile($thumbnail_file, '', 'w');
}
return;
}