mirror of
https://github.com/friendica/friendica
synced 2025-04-25 08:30:11 +00:00
Replace Lock::acquire() with DI::lock()->acquire()
This commit is contained in:
parent
e56c8dcc3c
commit
634e657d23
13 changed files with 38 additions and 52 deletions
|
@ -115,7 +115,7 @@ class Worker
|
|||
}
|
||||
|
||||
// Trying to fetch new processes - but only once when successful
|
||||
if (!$refetched && Lock::acquire('worker_process', 0)) {
|
||||
if (!$refetched && DI::lock()->acquire('worker_process', 0)) {
|
||||
self::findWorkerProcesses();
|
||||
Lock::release('worker_process');
|
||||
self::$state = self::STATE_REFETCH;
|
||||
|
@ -129,7 +129,7 @@ class Worker
|
|||
if (!self::getWaitingJobForPID()) {
|
||||
self::$state = self::STATE_LONG_LOOP;
|
||||
|
||||
if (Lock::acquire('worker', 0)) {
|
||||
if (DI::lock()->acquire('worker', 0)) {
|
||||
// Count active workers and compare them with a maximum value that depends on the load
|
||||
if (self::tooMuchWorkers()) {
|
||||
Logger::log('Active worker limit reached, quitting.', Logger::DEBUG);
|
||||
|
@ -933,7 +933,7 @@ class Worker
|
|||
}
|
||||
|
||||
$stamp = (float)microtime(true);
|
||||
if (!Lock::acquire('worker_process')) {
|
||||
if (!DI::lock()->acquire('worker_process')) {
|
||||
return false;
|
||||
}
|
||||
self::$lock_duration += (microtime(true) - $stamp);
|
||||
|
@ -1172,7 +1172,7 @@ class Worker
|
|||
}
|
||||
|
||||
// If there is a lock then we don't have to check for too much worker
|
||||
if (!Lock::acquire('worker', 0)) {
|
||||
if (!DI::lock()->acquire('worker', 0)) {
|
||||
return $added;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue