mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Removed methods to create tags and domains with lock, as they do not really lock as expected
This commit is contained in:
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Core\Repository;
|
||||
|
||||
use Doctrine\DBAL\LockMode;
|
||||
use Happyr\DoctrineSpecification\Repository\EntitySpecificationRepository;
|
||||
use Happyr\DoctrineSpecification\Spec;
|
||||
use Shlinkio\Shlink\Core\Entity\Tag;
|
||||
@@ -63,16 +62,4 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito
|
||||
|
||||
return $result > 0;
|
||||
}
|
||||
|
||||
public function findOneByNameWithLock(string $name): ?Tag
|
||||
{
|
||||
$qb = $this->createQueryBuilder('t');
|
||||
$qb->where($qb->expr()->eq('t.name', ':name'))
|
||||
->setParameter('name', $name)
|
||||
->setMaxResults(1);
|
||||
|
||||
$query = $qb->getQuery()->setLockMode(LockMode::PESSIMISTIC_WRITE);
|
||||
|
||||
return $query->getOneOrNullResult();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace Shlinkio\Shlink\Core\Repository;
|
||||
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
use Happyr\DoctrineSpecification\Repository\EntitySpecificationRepositoryInterface;
|
||||
use Shlinkio\Shlink\Core\Entity\Tag;
|
||||
use Shlinkio\Shlink\Core\Tag\Model\TagInfo;
|
||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||
|
||||
@@ -20,6 +19,4 @@ interface TagRepositoryInterface extends ObjectRepository, EntitySpecificationRe
|
||||
public function findTagsWithInfo(?ApiKey $apiKey = null): array;
|
||||
|
||||
public function tagExists(string $tag, ?ApiKey $apiKey = null): bool;
|
||||
|
||||
public function findOneByNameWithLock(string $name): ?Tag;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user