Added locking to short URL creation when checking if URL exists

This commit is contained in:
Alejandro Celaya
2021-05-02 10:33:27 +02:00
parent bf0c679a48
commit 3ff4ac84c4
9 changed files with 68 additions and 27 deletions

View File

@@ -58,7 +58,7 @@ class VisitsStatsHelper implements VisitsStatsHelperInterface
/** @var ShortUrlRepositoryInterface $repo */
$repo = $this->em->getRepository(ShortUrl::class);
if (! $repo->shortCodeIsInUse($identifier->shortCode(), $identifier->domain(), $spec)) {
if (! $repo->shortCodeIsInUse($identifier, $spec)) {
throw ShortUrlNotFoundException::fromNotFound($identifier);
}