mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 23:16:03 +00:00
job no table locking param
This commit is contained in:
@@ -49,4 +49,9 @@ class ConfigDataProvider
|
||||
{
|
||||
return (int) $this->config->get('cronMinInterval', 0);
|
||||
}
|
||||
|
||||
public function noTableLocking(): bool
|
||||
{
|
||||
return (bool) $this->config->get('jobNoTableLocking');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,12 +39,17 @@ use Spatie\Async\Pool as AsyncPool;
|
||||
|
||||
class QueueProcessor
|
||||
{
|
||||
private bool $noTableLocking;
|
||||
|
||||
public function __construct(
|
||||
private QueueUtil $queueUtil,
|
||||
private JobRunner $jobRunner,
|
||||
private AsyncPoolFactory $asyncPoolFactory,
|
||||
private EntityManager $entityManager
|
||||
) {}
|
||||
private EntityManager $entityManager,
|
||||
ConfigDataProvider $configDataProvider
|
||||
) {
|
||||
$this->noTableLocking = $configDataProvider->noTableLocking();
|
||||
}
|
||||
|
||||
public function process(Params $params): void
|
||||
{
|
||||
@@ -68,7 +73,7 @@ class QueueProcessor
|
||||
private function processJob(Params $params, JobEntity $job, ?AsyncPool $pool = null): void
|
||||
{
|
||||
$noLock = $params->noLock();
|
||||
$lockTable = $job->getScheduledJobId() && !$noLock;
|
||||
$lockTable = $job->getScheduledJobId() && !$noLock && !$this->noTableLocking;
|
||||
|
||||
if ($lockTable) {
|
||||
// MySQL doesn't allow to lock non-existent rows. We resort to locking an entire table.
|
||||
|
||||
@@ -101,6 +101,7 @@ return [
|
||||
'authLogDisabled',
|
||||
'authApiUserLogDisabled',
|
||||
'ipAddressServerParam',
|
||||
'jobNoTableLocking',
|
||||
],
|
||||
'adminItems' => [
|
||||
'devMode',
|
||||
|
||||
Reference in New Issue
Block a user